Developing ICEY#
Run tests:#
Tests are build by default, run them with:
cd <colcon-ws root>
./build/icey/test_main
Debug example node#
Useful: Install mixins: https://github.com/colcon/colcon-mixin-repository
colcon build --packages-select icey --mixin=debug
Run with GDB#
ros2 run --prefix 'gdb -ex run --args' icey_examples <node name>
GDB 101:#
r
runc
: continues, n
: step, next, respectivelyb <function name>
: just type the function name to set a breakpointbt
backtracep <expression name>
: print the content of a variable
If you want to look at an exception that gets catched:
catch throw
If your node crashes at Ctrl+C:handle SIGINT noprint nostop pass
Debug unit test:#
Since gtest catches the exceptions, we need to catch them earlier.
So type in gdb: catch throw
.
Then, do not use FastDDS since it uses exceptions as part of it’s regular (instead of exceptional) control-flow. CylconeDDS worked for me instead. Therefore, the overall command is:
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp gdb ./build/icey/test_main
Run clang-tidy:#
Compile with compile-commands:
colcon build --packages-select icey --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Install clang-15 and clang-tidy-15 apt packages, other versions do not work for me
Run clang-tidy
~/autoware/src/icey/icey clang-tidy -p ~/autoware/build/icey/ include/icey/*.hpp --fix -fix-errors
To fix the compilation with clang in case it does not build:
colcon build --packages-select icey --cmake-args -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15
Build documentation#
The doc
folder contains all files needed to build a documentation using the Sphinx site generator.
We parse the C++-code using doxygen
Dependencies:
Install doxygen:
sudo apt install doxygen
pip :
pip install -r requirements.txt
Build:
make html
Then, open the file _build/html/index.html in your browser for an offline view.
TODO deploy/GitHub actions