I kept copying code from the official documentation or from my previous works every time I created a new ROS package. With this cookiecutter template I hope the repetitive setup task can be reduced and I can jump directly into the development. For now it includes a simple publisher and subscriber, dynamic reconfigurable parameters, documentation generation with rosdoc_lite, linting and c++ debug setup.
pipx install cookiecutter
cookiecutter [email protected]:JosefGst/template_sub_pub.git
Choose name for the package, header and class.
rosrun {{cookiecutter.pkg_name}} {{cookiecutter.pkg_name}}_node
rosrun {{cookiecutter.pkg_name}} {{cookiecutter.pkg_name}}_node _pub_string:="hello" _rate:=1
roslaunch {{cookiecutter.pkg_name}} {{cookiecutter.pkg_name}}.launch pub_string:="hello" rate:=1
- chatter std_msgs/String
- cmd_vel (geometry_msgs/Twist)
- rate (int,default:1)
- publish rate of chatter" topic in [Hz]
- pub_string (string,default:"Hello World")
- published string on chatter topic
- Move the .vscode folder into the workspace directory.
- Edit the launch.json file as necessary.
- Run the "make_debug" task
- Click the Debug button on the left side in vscode. Select "ROS:Launch" and click the the green arrow.
In addition to the previous steps
- Run the "ROS:Start" task
- rosrun the node
- Click the green debug button with ROS:attach selected
Polyhobbyist Youtube vscode-ros github
In root of workspace
catkin_make roslint_{{cookiecutter.pkg_name}}
In root of package
rosdoc_lite .
To see the generated documentation website.
- make params reconfigurable
- debugging c++
- add tests
- github actions
- ros2 branch
- automatic documentation generation
- dockerization should be in separate docker_ws repo