It is assumed that the workspace is ~/ros2_ws/.
cd ~/ros2_ws/srcgit clone https://github.com/sze-info/ros2_py_templatecd ~/ros2_wscolcon build --packages-select ros2_py_template --symlink-installDon't forget to source before ROS commands.
source ~/ros2_ws/install/setup.bashros2 launch ros2_py_template launch_example1.launch.pyROS 2 pacage template, to get started, use template by clicking on the Green button labeled Use this template / Create new repository.
Let's assume
- your Github username is
mycoolusername - your ROS 2 repo shold be
cool_ros2_package
Replace everything in the cloned repo:
ros2_py_template>>cool_ros2_package(the folder was already renamed afterUse this template)sze-info>>mycoolusername- find all
todostrings and fill the blanks
The easiest way is VS code:
Important
Don't forget to rename the directory (folder) and the file too.
Now colcon build your ROS 2 package and you can start wokring.

