Mini Project: Humanoid Nervous System
Goal
In this mini-project, we will integrate all the ROS 2 components and concepts learned in this module to build a basic "nervous system" for our humanoid robot. This includes:
- Running
talkerandlistenernodes. - Visualizing the
humanoid.urdfin RViz2. - Operating the
control_loopnode with dummy sensor input. - Sending commands and receiving data through the
ai_bridgenode.
Integration Steps
-
Start the ROS 2 environment:
cd ~/ros2_ws
colcon build --symlink-install
source install/setup.bash -
Launch visualization and control:
# Open three separate terminals
# Terminal 1: Launch RViz2 and robot_state_publisher
ros2 launch ros2_foundations visualize.launch.py
# Terminal 2: Run the control loop node, which also publishes dummy IMU data
ros2 run ros2_foundations control_loop
# Terminal 3: Run the AI bridge node
ros2 run ros2_foundations ai_bridge -
Interact with the system:
- Observe the robot model in RViz2: The
shoulder_jointof the humanoid will articulate based on the simulated IMU data from thecontrol_loopnode. - Monitor
ai_bridgeoutput: The bridge node will log when it receives IMU data and attempts to send it to an "external AI". - Test AI commands (optional, requires a separate AI client node publishing to
/ai/command):Theros2 topic pub /ai/command std_msgs/String "data: '{\"action\": \"move_head\", \"direction\": \"left\"}'" --onceai_bridgenode will log this command.
- Observe the robot model in RViz2: The
Conclusion
This mini-project demonstrates the foundational components of a robot's nervous system using ROS 2, from basic communication to sensor processing and AI integration.