Unit 07 · lesson
`package.xml`: Declare What the Package Is
package.xml: Declare What the Package Is
Open:
~/ros2_ws/src/robotnix_pubsub/package.xml
The official package tutorial explains fields such as:
- package name;
- version;
- description;
- maintainer;
- license;
- dependencies;
- build type export.
Fill meaningful metadata
Replace TODO placeholders with course-appropriate values.
Example shape:
<description>Beginner ROS 2 Python publisher and subscriber</description>
<maintainer email="student@example.invalid">Student</maintainer>
<license>Apache-2.0</license>
Use the identity/email policy your course environment requires. Do not publish a student's private personal address just because a template asks for an email.
Runtime dependencies
Your nodes will import:
import rclpy
from std_msgs.msg import String
The official Python pub/sub tutorial declares runtime dependencies corresponding to those imports:
<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
Package metadata is not decorative
Tools such as rosdep inspect package declarations. Missing dependencies can become reproducibility problems even if one machine happens to have everything already installed.
Checkpoint
Explain why "it runs on my machine" is weaker evidence than a package that also declares what it needs.