|
| 1 | +# Debug Autoware |
| 2 | + |
| 3 | +This page provides some methods for debugging Autoware. |
| 4 | + |
| 5 | +## Print debug messages |
| 6 | + |
| 7 | +The essential thing for debug is to print the program information clearly, which can quickly judge the program operation and locate the problem. Autoware uses ROS2 logging tool to print debug messages, how to design console logging refer to tutorial [Console logging](../contributing/coding-guidelines/ros-nodes/console-logging.md). |
| 8 | + |
| 9 | +## Using ROS2 tools debug Autoware |
| 10 | + |
| 11 | +### Using command line tools |
| 12 | + |
| 13 | +ROS2 includes a suite of command-line tools for introspecting a ROS2 system. The main entry point for the tools is the command `ros2`, which itself has various sub-commands for introspecting and working with nodes, topics, services, and more. How to use the ROS2 command line tool refer to tutorial [CLI tools](http://docs.ros.org/en/galactic/Tutorials/Beginner-CLI-Tools.html). |
| 14 | + |
| 15 | +### Using rviz2 |
| 16 | + |
| 17 | +Rviz2 is a port of Rviz to ROS2. It provides a graphical interface for users to view their robot, sensor data, maps, and more. You can run Rviz2 tool easily by: |
| 18 | +it will open |
| 19 | + |
| 20 | +```console |
| 21 | +rviz2 |
| 22 | +``` |
| 23 | + |
| 24 | +When Autoware launch the simulators, the Rviz2 tool is opened by default to visualize the autopilot graphic information. |
| 25 | + |
| 26 | +### Using rqt tools |
| 27 | + |
| 28 | +RQt is a graphical user interface framework that implements various tools and interfaces in the form of plugins. You can run any RQt tools/plugins easily by: |
| 29 | + |
| 30 | +```console |
| 31 | +rqt |
| 32 | +``` |
| 33 | + |
| 34 | +This GUI allows you to choose any available plugins on your system. You can also run plugins in standalone windows. For example, RQt Console: |
| 35 | + |
| 36 | +```console |
| 37 | +ros2 run rqt_console rqt_console |
| 38 | +``` |
| 39 | + |
| 40 | +#### Common RQt tools |
| 41 | + |
| 42 | +1. rqt_graph: view node interaction |
| 43 | + |
| 44 | + In complex applications, it may be helpful to get a visual representation of the ROS node interactions. |
| 45 | + |
| 46 | + ```console |
| 47 | + ros2 run rqt_graph rqt_graph |
| 48 | + ``` |
| 49 | + |
| 50 | +2. rqt_console: view messages |
| 51 | + |
| 52 | + rqt_console is a great gui for viewing ROS topics. |
| 53 | + |
| 54 | + ```console |
| 55 | + ros2 run rqt_console rqt_console |
| 56 | + ``` |
| 57 | + |
| 58 | +3. rqt_plot: view data plots |
| 59 | + |
| 60 | + rqt_plot is an easy way to plot ROS data in real time. |
| 61 | + |
| 62 | + ```console |
| 63 | + ros2 run rqt_plot rqt_plot |
| 64 | + ``` |
| 65 | + |
| 66 | +## Using a debugger with breakpoints |
| 67 | + |
| 68 | +Many IDE(e.g. VSCode, CLion) supports debugging C/C++ executable with GBD on linux platform. The following lists some references for using the debugger: |
| 69 | + |
| 70 | +- <https://code.visualstudio.com/docs/cpp/cpp-debug> |
| 71 | +- <https://www.jetbrains.com/help/clion/debugging-code.html#useful-debugger-shortcuts> |
0 commit comments