|
1 | 1 | # Table of Contents |
2 | 2 |
|
3 | 3 | - [Overview](#overview) |
| 4 | +- [3D Robot Visualization](#3d-robot-visualization) |
4 | 5 | - [Running the System](#running-the-system) |
5 | 6 |
|
6 | 7 | # Overview |
@@ -39,6 +40,153 @@ ros-source |
39 | 40 |
|
40 | 41 | - `/robot/state_manager/diagnostics` - Diagnostics |
41 | 42 |
|
| 43 | +# 3D Robot Visualization |
| 44 | + |
| 45 | +The `coffee_robot_description` package provides 3D visualization capabilities for the Coffee Buddy robot using URDF, RViz, and Gazebo. |
| 46 | + |
| 47 | +## Dependencies Installation |
| 48 | + |
| 49 | +First, install the required ROS2 packages: |
| 50 | + |
| 51 | +```bash |
| 52 | +# Install core dependencies |
| 53 | +sudo apt update |
| 54 | +sudo apt install ros-jazzy-xacro ros-jazzy-robot-state-publisher ros-jazzy-rviz2 |
| 55 | + |
| 56 | +# Optional: Install joint state publishers for manual control |
| 57 | +sudo apt install ros-jazzy-joint-state-publisher ros-jazzy-joint-state-publisher-gui |
| 58 | +``` |
| 59 | + |
| 60 | +## Building the Package |
| 61 | + |
| 62 | +```bash |
| 63 | +# Build the robot description package |
| 64 | +cd coffee_ws |
| 65 | +colcon build --packages-select coffee_robot_description |
| 66 | +source install/setup.bash |
| 67 | +``` |
| 68 | + |
| 69 | +## Available Launch Files |
| 70 | + |
| 71 | +### 1. Basic Robot State Publisher |
| 72 | +Real-time 3D visualization that integrates with existing head control system: |
| 73 | + |
| 74 | +```bash |
| 75 | +# Launch robot state publisher with TF integration |
| 76 | +ros2 launch coffee_robot_description robot_state_publisher.launch.py |
| 77 | + |
| 78 | +# This automatically: |
| 79 | +# - Loads the robot URDF model |
| 80 | +# - Starts TF publisher that converts motor angles to joint states |
| 81 | +# - Publishes robot description to /robot_description topic |
| 82 | +``` |
| 83 | + |
| 84 | +### 2. RViz Visualization with GUI Controls |
| 85 | +Interactive 3D visualization with manual joint controls: |
| 86 | + |
| 87 | +```bash |
| 88 | +# Launch RViz with robot model and joint controls |
| 89 | +ros2 launch coffee_robot_description rviz_display.launch.py |
| 90 | + |
| 91 | +# Features: |
| 92 | +# - 3D robot model visualization |
| 93 | +# - Manual joint sliders for testing |
| 94 | +# - TF tree visualization |
| 95 | +# - Camera view display |
| 96 | +# - Pre-configured RViz setup |
| 97 | +``` |
| 98 | + |
| 99 | +### 3. Gazebo Physics Simulation |
| 100 | +Full physics simulation environment: |
| 101 | + |
| 102 | +```bash |
| 103 | +# Launch Gazebo simulation with robot model |
| 104 | +ros2 launch coffee_robot_description gazebo_sim.launch.py |
| 105 | + |
| 106 | +# Features: |
| 107 | +# - Physics simulation |
| 108 | +# - Camera sensor simulation (1920x1080, 80° FOV) |
| 109 | +# - IMU sensor simulation |
| 110 | +# - ROS2 control integration |
| 111 | +# - Joint trajectory controllers |
| 112 | +``` |
| 113 | + |
| 114 | +## Robot Model Features |
| 115 | + |
| 116 | +The URDF model includes: |
| 117 | + |
| 118 | +- **Coffee Machine Base**: Delonghi Prima Donna with water tank, drip tray, control panel |
| 119 | +- **3DOF Neck Assembly**: Pan/Tilt (current hardware) + Roll (future expansion) |
| 120 | +- **Robot Head**: LCD display, Logitech Brio camera mount, movable ears |
| 121 | +- **Sensor Integration**: Camera frames, IMU, Gazebo plugins |
| 122 | + |
| 123 | +## Hardware Integration |
| 124 | + |
| 125 | +The TF publisher automatically converts motor coordinates to URDF coordinates: |
| 126 | + |
| 127 | +- **Current Hardware**: 2x Dynamixel XM540-W270 (Pan ID:1, Tilt ID:9) |
| 128 | +- **Motor Limits**: Pan 143-210°, Tilt 169-206° (both centered at 180°) |
| 129 | +- **URDF Limits**: Converted to standard 0° center coordinates |
| 130 | +- **Future Ready**: 3rd DOF roll motor and ear actuation pre-defined |
| 131 | + |
| 132 | +## Topics and TF Tree |
| 133 | + |
| 134 | +**Subscribed Topics:** |
| 135 | +- `/head_pan_angle` - Current pan motor angle (from existing head control) |
| 136 | +- `/head_tilt_angle` - Current tilt motor angle (from existing head control) |
| 137 | + |
| 138 | +**Published Topics:** |
| 139 | +- `/robot_description` - Robot URDF description |
| 140 | +- `/joint_states` - Current joint positions |
| 141 | +- `/tf` and `/tf_static` - Transform tree |
| 142 | + |
| 143 | +**TF Tree:** |
| 144 | +``` |
| 145 | +world → base_link → neck_mount → neck_yaw → neck_pitch → neck_roll → head |
| 146 | + ├─ camera_link |
| 147 | + ├─ display_link |
| 148 | + ├─ left_ear |
| 149 | + └─ right_ear |
| 150 | +``` |
| 151 | + |
| 152 | +## Configuration Files |
| 153 | + |
| 154 | +- `config/joint_limits.yaml` - Joint limits based on current hardware |
| 155 | +- `config/controllers.yaml` - ROS2 control configuration |
| 156 | +- `rviz/coffee_robot.rviz` - Pre-configured RViz setup |
| 157 | + |
| 158 | +## Testing Integration |
| 159 | + |
| 160 | +To test the integration with the existing head control system: |
| 161 | + |
| 162 | +```bash |
| 163 | +# Terminal 1: Start robot visualization |
| 164 | +ros2 launch coffee_robot_description robot_state_publisher.launch.py |
| 165 | + |
| 166 | +# Terminal 2: Start RViz (optional) |
| 167 | +ros2 launch coffee_robot_description rviz_display.launch.py |
| 168 | + |
| 169 | +# Terminal 3: Run existing head control system |
| 170 | +ros2 run coffee_head_control head_tracking |
| 171 | + |
| 172 | +# Terminal 4: Run camera for face tracking |
| 173 | +ros2 run coffee_vision camera_node |
| 174 | + |
| 175 | +# The 3D model will now move in real-time with the physical robot head! |
| 176 | +``` |
| 177 | + |
| 178 | +## Troubleshooting |
| 179 | + |
| 180 | +**Import Error for FindPackageShare:** |
| 181 | +- Fixed in ROS2 Jazzy - uses `launch_ros.substitutions.FindPackageShare` |
| 182 | + |
| 183 | +**xacro command not found:** |
| 184 | +- Install: `sudo apt install ros-jazzy-xacro` |
| 185 | + |
| 186 | +**Joint limits:** |
| 187 | +- Current limits based on physical motor constraints |
| 188 | +- Future hardware can extend limits in `config/joint_limits.yaml` |
| 189 | + |
42 | 190 | # Running the System |
43 | 191 |
|
44 | 192 | Commands to launch separate nodes: |
|
0 commit comments