# go2_driver **Repository Path**: AlEX_2473/go2_driver ## Basic Information - **Project Name**: go2_driver - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: go2 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-27 - **Last Updated**: 2026-05-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # go2_driver > Readme generated by GLM-5 Unitree Go2 Robot Driver for ROS2 ## Overview This package provides ROS2 drivers for the Unitree Go2 quadruped robot, including: - IMU and leg sensor data publishing - Head camera streaming - Velocity command control - Point cloud compression ## Supported ROS2 Versions - Foxy (Ubuntu 20.04) - Humble (Ubuntu 22.04) - Jazzy (Ubuntu 24.04) ## Dependencies - `rclcpp` - ROS2 C++ client library - `unitree_go` - Unitree Go message definitions - `unitree_api` - Unitree API for robot control - `sensor_msgs` - Sensor message types - `geometry_msgs` - Geometry message types - `std_msgs` - Standard message types - `point_cloud_transport` - Point cloud transport (optional) - `draco_point_cloud_transport` - Draco point cloud compression (optional) - OpenCV4 - Image processing ## Build ```bash cd ~/ros2_ws colcon build --packages-select go2_driver ``` ## Nodes ### lowstate_driver Publishes IMU and leg sensor data from the robot's LowState messages. **Parameters:** | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `imu_enable` | bool | `true` | Enable IMU publishing | | `leg_sensor_enable` | bool | `false` | Enable leg sensor publishing | | `imu_topic` | string | `/imu` | IMU topic name | | `leg_sensor_topic` | string | `/leg_sensor` | Leg sensor topic name | | `use_sim_time` | bool | `false` | Use simulation time | **Published Topics:** - `/imu` (sensor_msgs/Imu) - IMU data - `/leg_sensor` (go2_driver/LegSensor) - Leg sensor data ### head_camera Streams head camera video using GStreamer and publishes as ROS2 image topics. **Parameters:** | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `pub_camera_raw_enable` | bool | `false` | Enable raw image publishing | | `pub_camera_compressed_enable` | bool | `false` | Enable compressed image publishing | | `pub_camera_topic` | string | `/head_camera/image_raw` | Image topic base name | | `network_interface` | string | `eth0` | Network interface for UDP stream | | `gst_pipeline` | string | - | GStreamer pipeline string | **Published Topics:** - `_Raw` (sensor_msgs/Image) - Raw image - `_Compressed` (sensor_msgs/CompressedImage) - Compressed image ### sportstate_cmd_vel Converts geometry_msgs/Twist commands to Unitree Sport API requests for robot velocity control. **Subscribed Topics:** - `/cmd_vel` (geometry_msgs/Twist) - Velocity command **Published Topics:** - `/api/sport/request` (unitree_api/Request) - Sport API request ## Launch Files ### driver.launch.py Main launch file that starts all driver nodes: ```bash ros2 launch go2_driver driver.launch.py ``` **Launch Arguments:** | Argument | Default | Description | |----------|---------|-------------| | `use_rviz` | `false` | Launch RViz2 | | `use_sim_time` | `false` | Use simulation time | **Includes:** - lowstate_driver node - head_camera node - sportstate_cmd_vel node - Point cloud compression nodes (utlidar, rslidar) ## Message Types ### LegSensor (go2_driver/LegSensor) ``` uint64 timestamp_ns # Timestamp in nanoseconds float32[12] q # Joint positions float32[12] dq # Joint velocities float32[12] tau # Estimated joint torques int16[4] foot_force # Foot force sensors float32[4] imu_quaternion # IMU quaternion [w,x,y,z] float32[3] imu_gyroscope # IMU gyroscope data float32[3] imu_accelerometer # IMU accelerometer data ``` ## Configuration Example ```yaml # config.yaml /**: ros__parameters: use_sim_time: false /lowstate_driver: ros__parameters: imu_enable: true leg_sensor_enable: true imu_topic: /imu leg_sensor_topic: /leg_sensor /head_camera: ros__parameters: pub_camera_raw_enable: true pub_camera_compressed_enable: true pub_camera_topic: /head_camera/image_raw network_interface: eth0 gst_pipeline: > udpsrc address=230.1.1.1 port=1720 multicast-iface=eth0 ! application/x-rtp,media=video,encoding-name=H264 ! rtph264depay ! h264parse ! nvv4l2decoder enable-max-performance=1 ! nvvidconv output-buffers=1 ! video/x-raw,format=BGRx,width=1280,height=720 ! videoconvert ! video/x-raw,format=BGR ! appsink drop=1 sync=false ``` ## Troubleshooting ### Camera stream not opening Check network interface and firewall settings: ```bash # Verify network interface ip addr show eth0 # Check if UDP port 1720 is open sudo iptables -L -n | grep 1720 ``` ### IMU data not publishing Verify LowState topic is being published by the robot: ```bash ros2 topic hz /lowstate ``` ### Point cloud compression issues Ensure point_cloud_transport and draco_point_cloud_transport are installed: ```bash sudo apt install ros-${ROS_DISTRO}-point-cloud-transport ros-${ROS_DISTRO}-draco-point-cloud-transport ``` ## License BSD-3-Clause