Creating your Team's ROS 2 Package¶
You should use the same procedures as you did in the Simulation Labs to create a ROS 2 package for this assignment (described again below). You should create one package per team, so nominate one member of your team to do this bit.
You should do this from within your own local ROS installation (i.e. on your own computer), or a WSL-ROS2 terminal instance.
-
Head to the
srcfolder of your ROS 2 workspace in your terminal: -
Clone the ROS 2 Package Template from GitHub:
-
Run the
init_pkg.shscript as follows (pay attention to the further information below about the naming of your package):Your package must be named as follows:
ele434_teamXX_2026... where
XXshould be replaced with your team number (see Blackboard if you are unsure what your team's number is).If your team number is less than 10: put a zero before it, so that the team number is always 2 digits long, e.g.:
ele434_team03_2026for Team 3ele434_team08_2026for Team 8ele434_team15_2026for Team 15
Important
Your repository name should match the above format exactly:
- The name should be 18 characters long in total.
- All characters should be lower case (e.g.
ele434, NOTELE434)
-
Next, navigate into the root of your new package:
...and create a new directory in there called
launch: -
Inside here create an empty file called
explore.launch.py:... leave this empty for now. You'll need to populate this appropriately later (more details on the Task Brief).
-
Open up your package's
CMakeLists.txtfile and add the following text just above theament_package()line at the very bottom: -
You can now build this using Colcon by following the same three-step process that you have been following throughout the Simulation Lab Course:
-
Step 1, navigate to the root of the ROS 2 workspace:
-
Step 2, build your package with Colcon:
-
Step 3, re-source the
.bashrc:
Don't forget
You'll need to follow the above three-step
colcon buildprocess whenever you do things like:- Add a new node to your package (don't forget to modify the
CMakeLists.txtfile too) - Add or modify a launch file
- Add or modify a custom interface (like in Part 1)
- Copy your package onto a different computer
-