IntelligentRoboticsLabs / go2_robot

Implementation for Unitree GO 2 in ROS 2
BSD 3-Clause "New" or "Revised" License
76 stars 11 forks source link

Unitree GO2 Robot ROS 2

Go2 point cloud

License distro distro humble humble-devel

In this package is our integration for the Unitee Go2 robot.

Checklist

Installation

You need to have previously installed ROS2. Please follow this guide if you don't have it.

source /opt/ros/humble/setup.bash

Create workspace and clone the repository

mkdir ~/go2_ws/src
cd ~/go2_ws/src
git clone https://github.com/IntelligentRoboticsLabs/go2_robot.git -b humble

Install dependencies and build workspace

cd ~/go2_ws
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install 

Setup the workspace

source ~/ros2_ws/install/setup.bash

Sensor installation

If you have purchased a hesai lidar 3d, or a realsense d435i, follow the following steps inside the robot.

Hesai Lidar

sudo apt-get install libboost-all-dev
sudo apt-get install -y libyaml-cpp-dev
git clone --recurse-submodules https://github.com/HesaiTechnology/HesaiLidar_ROS_2.0.git
cd ..
source /opt/ros/$ROS_DISTRO/setup.bash
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
source install/setup.bash

Set the lidar IP to config/config.yaml

lidar:
- driver:
    udp_port: 2368                                       #UDP port of lidar
    ptc_port: 9347                                       #PTC port of lidar
    device_ip_address: <Device IP>                       #IP address of lidar
    pcap_path: "<Your PCAP file path>"                   #The path of pcap file (set during offline playback)
    correction_file_path: "<Your correction file path>"  #LiDAR angle file, required for offline playback of pcap/packet rosbag
    firetimes_path: "<Your firetime file path>"          #The path of firetimes file
    source_type: 2                                       #The type of data source, 1: real-time lidar connection, 2: pcap, 3: packet rosbag
    pcap_play_synchronization: true                      #Pcap play rate synchronize with the host time
    x: 0                                                 #Calibration parameter
    y: 0                                                 #Calibration parameter
    z: 0                                                 #Calibration parameter
    roll: 0                                              #Calibration parameter
    pitch: 0                                             #Calibration parameter
    yaw: 0                                               #Calibration parameter
ros:
    ros_frame_id: hesai_lidar                            #Frame id of packet message and point cloud message
    ros_recv_packet_topic: /lidar_packets                #Topic used to receive lidar packets from ROS
    ros_send_packet_topic: /lidar_packets                #Topic used to send lidar packets through ROS
    ros_send_point_cloud_topic: /lidar_points            #Topic used to send point cloud through ROS
    send_packet_ros: true                                #true: Send packets through ROS 
    send_point_cloud_ros: true                           #true: Send point cloud through ROS 

Realsense d435i

sudo apt install ros-humble-realsense2-camera

Usage

Bringup the robot

Either from your computer, or from inside the robot, execute the following:

ros2 launch go2_bringup go2.launch.py

If you have a realsense and a lidar inside the robot, use the lidar or realsense parameters. It will only work if you throw everything inside the robot

If you want to see your robot through rviz, do it as follows:

ros2 launch go2_bringup go2.launch.py rviz:=True

Change modes

If what you want is for your robot to be able to change modes, thus performing the movements predefined by the controller, use the following service:

ros2 service call /mode go2_interfaces/srv/Mode "mode: 'hello'"
Available modes ``` damp balance_stand stop_move stand_up stand_down sit rise_sit hello stretch wallow scrape front_flip front_jump front_pounce dance1 dance2 finger_heart ```

Change configurations for robot

If you want, you can modify the ways the robot walks, the height of the base, the height of the legs when walking... I show you the different parameters that can be modified:

SLAM

In the future, work in progress.

NAVIGATION

In the future, work in progress.

Demos

Robot description

go2_tf.webm

Robot PointCloud

https://github.com/IntelligentRoboticsLabs/go2_robot/assets/44479765/c164840a-6857-4d95-a50e-023c5bb44edb

Acknowledgment

Thanks to unitree for providing the support and communication interfaces with the robot.

About

This is a project made by the Intelligent Robotics Lab, a research group from the Universidad Rey Juan Carlos. Copyright © 2024.

Maintainers:

License

This project is licensed under the BSD 3-clause License - see the LICENSE file for details.