Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(how-to-guides): add debug autoware guides #268

Merged
merged 8 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/how-to-guides/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ nav:
- running-autoware-without-cuda.md
- calibrating-your-sensors.md
- evaluating-controller-performance.md
- debug-autoware.md
- add-a-custom-ros-message.md
71 changes: 71 additions & 0 deletions docs/how-to-guides/debug-autoware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Debug Autoware

This page provides some methods for debugging Autoware.

## Print debug messages

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).

## Using ROS2 tools debug Autoware

### Using command line tools

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).

### Using rviz2

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:
it will open

```console
rviz2
```

When Autoware launch the simulators, the Rviz2 tool is opened by default to visualize the autopilot graphic information.

### Using rqt tools

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:

```console
rqt
```

This GUI allows you to choose any available plugins on your system. You can also run plugins in standalone windows. For example, RQt Console:

```console
ros2 run rqt_console rqt_console
```

#### Common RQt tools

1. rqt_graph: view node interaction

In complex applications, it may be helpful to get a visual representation of the ROS node interactions.

```console
ros2 run rqt_graph rqt_graph
```

2. rqt_console: view messages

rqt_console is a great gui for viewing ROS topics.

```console
ros2 run rqt_console rqt_console
```

3. rqt_plot: view data plots

rqt_plot is an easy way to plot ROS data in real time.

```console
ros2 run rqt_plot rqt_plot
```

## Using a debugger with breakpoints

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:

- <https://code.visualstudio.com/docs/cpp/cpp-debug>
- <https://www.jetbrains.com/help/clion/debugging-code.html#useful-debugger-shortcuts>
2 changes: 1 addition & 1 deletion docs/how-to-guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
- [Calibrating your sensors](calibrating-your-sensors.md)
- [Applying Clang-Tidy to ROS packages](applying-clang-tidy-to-ros-packages.md)
- [Evaluating controller performance](evaluating-controller-performance.md)
- [Debug Autoware](debug-autoware.md)
- [Add a custom ROS message](add-a-custom-ros-message.md)

TODO: Write the following contents.

- Create an Autoware package
- Debug Autoware
- etc.