Package types
ROS2 supports two main package types:- ament_cmake - For C++ packages and mixed C++/Python packages
- ament_python - For pure Python packages
Creating a C++ package
Creating a Python package
Build the package
--symlink-install for Python packages to modify code without rebuilding.Adding dependencies
Specify package dependencies inpackage.xml:
Adding existing packages
To include external ROS2 packages:Package verification
After creating packages, verify they were correctly installed:package.xml files from TurtleBot3 repositories.
Best practices
- Use descriptive package names that reflect functionality
- Always specify dependencies in
package.xml - Use
--symlink-installfor Python packages during development - Test packages immediately after creation
- Commit package source code to version control
- Document package purpose in the description field