Unit 07 · lesson
Declare Dependencies and Executables
Your Python files now exist. ROS still needs package/install metadata.
package.xml
Make sure runtime dependencies include:
<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
setup.py
Add console scripts:
entry_points={
'console_scripts': [
'hello = robotnix_pubsub.hello_node:main',
'talker = robotnix_pubsub.talker:main',
'listener = robotnix_pubsub.listener:main',
],
},
Read the path carefully
talker
= robotnix_pubsub.talker : main
└ module package/file └ function
A typo here can build successfully and still make ros2 run unable to launch the executable correctly.
Resolve dependencies
From the workspace root:
cd ~/ros2_ws
rosdep install -i --from-path src --rosdistro jazzy -y
Checkpoint
For every executable, prove the target Python module and main() function actually exist.