Chapter 8: Real Robot Deployment

Hardware Setup

TurtleBot3 Setup

# Install TurtleBot3 packages
sudo apt install ros-humble-turtlebot3*

# Set robot model
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
source ~/.bashrc

# Launch robot
ros2 launch turtlebot3_bringup robot.launch.py

Remote Connection

# On robot
export ROS_DOMAIN_ID=30

# On laptop
export ROS_DOMAIN_ID=30
export ROS_LOCALHOST_ONLY=0

Debugging Tools

# Check node health
ros2 node list
ros2 node info /node_name

# Monitor topics
ros2 topic hz /scan
ros2 topic bw /camera/image_raw

# Check TF tree
ros2 run tf2_tools view_frames

Performance Optimization

# Use QoS for real-time
from rclpy.qos import QoSProfile, ReliabilityPolicy

qos = QoSProfile(
    reliability=ReliabilityPolicy.BEST_EFFORT,
    depth=1
)

self.subscription = self.create_subscription(
    LaserScan,
    'scan',
    self.callback,
    qos
)

Safety Considerations

  • Emergency stop button
  • Watchdog timers
  • Velocity limits
  • Collision detection
  • Battery monitoring

Deployment Checklist

  • Test in simulation
  • Verify sensor calibration
  • Check network connectivity
  • Test emergency stop
  • Monitor system resources
  • Log data for analysis

Congratulations! You've completed the ROS2 course! 🤖🎓