brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | [General] |
| 2 | Check the logs! Very few things will fail without putting something in the logs. |
| 3 | If they do, that is a bug unless our code is never getting run (there are |
| 4 | innumerable ways that could happen, but it generally doesn't). |
Brian Silverman | e155ebc | 2014-03-20 19:37:57 -0700 | [diff] [blame] | 5 | To check the logs, run `log_displayer` if `binary_log_writer` has been started |
| 6 | or just run `log_streamer` if you want to do simple testing without writing |
| 7 | logs to a file. See `log_displayer --help` for options. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 8 | All of the binaries get put in the same place. That is |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 9 | src/outputs/prime/outputs on the build machine and |
| 10 | /home/driver/robot_code/bin on linux. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | |
| 12 | [Startup] |
Brian Silverman | e155ebc | 2014-03-20 19:37:57 -0700 | [diff] [blame] | 13 | Low level startup errors often end up in |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 14 | /tmp/aos_fatal_error.* under linux. Also helpful are the /tmp/starter*_std* |
Brian Silverman | 20141f9 | 2015-01-05 17:39:01 -0800 | [diff] [blame] | 15 | files (if the standard start scripts are being used). |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 16 | If lots of the /tmp/starter_*std* files (with different numbers) are being |
| 17 | created, that means that starter_exe is dying constantly. |
| 18 | |
| 19 | [Anything Not Running] |
| 20 | Check starter_exe's log messages. They might mention that it is constantly dying |
| 21 | on startup and being restarted. |
| 22 | |
| 23 | [Control Loop(s) Not Working] |
Brian Silverman | e155ebc | 2014-03-20 19:37:57 -0700 | [diff] [blame] | 24 | Are robot_state messages going out? An aos::JoystickInput (often |
| 25 | joystick_reader) should be sending them. |
Brian Silverman | c206573 | 2015-11-28 22:55:30 +0000 | [diff] [blame] | 26 | Also, kFakeJoysticks in aos/input/joystick_reader.cc has to be set to |
Brian Silverman | e155ebc | 2014-03-20 19:37:57 -0700 | [diff] [blame] | 27 | false in order for anything to get output. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 28 | Is it being fed goal messages? |
| 29 | Is it getting position messages? |
| 30 | Is something looking at the output and doing something useful with it? |
| 31 | |
| 32 | [No Driver Station Packets] |
Brian Silverman | e155ebc | 2014-03-20 19:37:57 -0700 | [diff] [blame] | 33 | TODO(brians): This is out of date. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 34 | Check to make sure that JSR (a cRIO-side task) is saying that it's sending |
| 35 | messages. Also check JoystickReader (or whatever inherits from |
| 36 | aos::JoystickInput) is running and see if it's receiving anything. |
| 37 | |
| 38 | [Attaching a Debugger] |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 39 | Attaching GDB to an existing robot code process works like normal (you have to |
Brian Silverman | e155ebc | 2014-03-20 19:37:57 -0700 | [diff] [blame] | 40 | su root first because that's what all of the code currently runs as). |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 41 | If a process is dying repeatedly, the easiest way to debug it is to kill |
| 42 | starter_loop.sh and (it has to be after that) starter_exe. After doing that, |
| 43 | NOTHING will get restarted (including the normal restart after changing a |
| 44 | binary) so that you can start a process under GDB like usual (shouldn't need |
| 45 | anything special if done as root). |