Repository Summary
Description | Full Autonomy Stack for Unitree Go2 |
Checkout URI | https://github.com/jizhang-cmu/autonomy_stack_go2.git |
VCS Type | git |
VCS Version | foxy-humble |
Last Updated | 2025-04-01 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
local_planner | 0.0.1 |
sensor_scan_generation | 0.0.1 |
terrain_analysis | 0.0.1 |
terrain_analysis_ext | 0.0.1 |
vehicle_simulator | 0.0.1 |
visualization_tools | 0.0.1 |
waypoint_example | 0.0.1 |
boundary_handler | 0.0.1 |
far_planner | 0.0.1 |
graph_decoder | 0.0.1 |
visibility_graph_msg | 0.0.1 |
point_lio_unilidar | 0.0.0 |
ros_tcp_endpoint | 0.7.0 |
calibrate_imu | 0.0.0 |
goalpoint_rviz_plugin | 0.0.1 |
teleop_rviz_plugin | 0.0.1 |
teleop_rviz_plugin_plus | 0.0.1 |
transform_sensors | 0.0.0 |
go2_h264_repub | 0.0.0 |
go2_sport_api | 0.0.0 |
unitree_api | 0.0.0 |
unitree_go | 0.0.0 |
waypoint_rviz_plugin | 0.0.1 |
README
The repository contains the full autonomy stack for the Unitree Go2 platform. The system provides a navigation capability of taking a goal point and navigating Go2 autonomously to the goal point while building a map along the way. Alternatively, the system allows users to use a joystick controller to guide the navigation while the system itself is in charge of collision avoidance. The system uses only built-in sensors on Go2 - the L1 lidar and the IMU in the lidar. The system contains a SLAM module, a route planner, and a based autonomy system, where the base autonomy system further includes fundamental navigation modules for terrain traversability analysts, collision avoidance, and waypoint following. Users can run the system on the onboard computer or an external computer connected to Go2 via an Ethernet cable. Please make sure to use the Go2 EDU version which has SDK support.
Simulation Setup
Base Autonomy
The system is integrated with Unity environment models. For simulation, the repository has been tested in Ubuntu 22.04 with ROS2 Foxy and Ubuntu 22.04 with ROS2 Humble. Install dependencies with the command lines below.
For Foxy:
sudo apt update
sudo apt install libusb-dev ros-foxy-perception-pcl ros-foxy-sensor-msgs-py ros-foxy-tf-transformations ros-foxy-joy ros-foxy-rmw-cyclonedds-cpp ros-foxy-rosidl-generator-dds-idl python3-colcon-common-extensions python-is-python3
pip install transforms3d pyyaml
For Humble:
sudo apt update
sudo apt install libusb-dev ros-humble-perception-pcl ros-humble-sensor-msgs-py ros-humble-tf-transformations ros-humble-joy ros-humble-rmw-cyclonedds-cpp ros-humble-rosidl-generator-dds-idl python3-colcon-common-extensions python-is-python3
pip install transforms3d pyyaml
Clone the open-source repository.
git clone https://github.com/jizhang-cmu/autonomy_stack_go2.git
In a terminal, go to the folder and compile.
cd autonomy_stack_go2
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
Download a Unity environment model for Go2 and unzip to the ’src/base_autonomy/vehicle_simulator/mesh/unity’ folder. The environment model files should look like below.
mesh/
unity/
environment/
Model_Data/ (multiple files in the folder)
Model.x86_64
UnityPlayer.so
AssetList.csv (generated at runtime)
Dimensions.csv
Categories.csv
map.ply
object_list.txt
traversable_area.ply
map.jpg
render.jpg
In a terminal, go to the repository folder and launch the system.
./system_simulation.sh
After seeing data showing up in RVIZ, users can use the ‘Waypoint’ button to set waypoints and navigate the vehicle around. Note that the waypoints are meant to be relatively close to the vehicle. Setting the waypoint too far can cause the vehicle to get stuck at a dead end. Users can also operate in smart joystick mode where the vehicle tries to follow joystick commands and also avoid collisions. To do this, users can use the control panel in RVIZ or a PS3/4 or Xbox controller with a USB or Bluetooth interface. When using the controller, users can also operate in manual mode without any collision avoidance. Detailed information about the operations in the three modes is below.
-
Smart joystick mode (default): The vehicle tries to follow joystick commands and also avoid collisions. Use the control panel in RVIZ or the right joystick on the controller to set the speed and yaw rate. If the system is in another mode, doing so will switch the system to smart joystick mode.
-
Waypoint mode: The vehicle tries to follow waypoints and also avoid collisions. Use the ‘Waypoint’ button in RVIZ to set a waypoint by first clicking the button and then clicking where the waypoint is to be set around the vehicle. If the system is in another mode, clicking the ‘Resume Navigation to Goal’ button in RVIZ switches the system to waypoint mode. Or, users can hold the ‘waypoint-mode’ button on the controller and use the right joystick to set the speed. If only holding the ‘waypoint-mode’ button, the system will use the speed sent in ROS messages.
-
Manual mode: The vehicle tries to follow joystick commands without any collision avoidance. Pressing the ‘manual-mode’ button on the controller switches the system to manual mode. Then, use the right joystick to set the forward and lateral speed and the left joystick to set the yaw rate, in the Mode 2 convention.
Alternatively, users can run a ROS node to send a series of waypoints. In another terminal, go to the folder and source the ROS workspace, then run the ROS node with the command lines below. The ROS node sends navigation boundary and speed as well. Click the ‘Resume Navigation to Goal’ button in RVIZ, and the vehicle will navigate inside the boundary following the waypoints. More information about the base autonomy system is available on the Autonomous Exploration Development Environment website.
source install/setup.sh
ros2 launch waypoint_example waypoint_example.launch
Route Planner
To launch the system with route planner, use the command line below.
./system_simulation_with_route_planner.sh
Users can send a goal point with the ‘Goalpoint’ button in RVIZ. The vehicle will navigate to the goal and build a visibility graph (in cyan) along the way. Areas covered by the visibility graph become free space. When navigating in free space, the planner uses the built visibility graph, and when navigating in unknown space, the planner attempts to discover a way to the goal. By pressing the ‘Reset Visibility Graph’ button, the planner will reinitialize the visibility graph. By unchecking the ‘Planning Attemptable’ checkbox, the planner will first try to find a path through the free space. The path will show in green. If such a path does not exist, the planner will consider unknown space together. The path will show in blue. By unchecking the ‘Update Visibility Graph’ checkbox, the planner will stop updating the visibility graph. When navigating with the route planner, the base system operates in waypoint mode. Users can click in the black box on the control panel to switch to smart joystick mode, or press the buttons on a joystick controller to switch to smart joystick mode or manual mode. To resume route planner navigation, click the ‘Resume Navigation to Goal’ button in RVIZ or use the ‘Goalpoint’ button to set a new goalpoint. More information about the route planner is available on the FAR Planner website.
Real-robot Setup
Hardware
We set up a quick and easy communication module on Go2 with a wireless HDMI transmitter and a pair of wireless keyboard and mouse. The communication module is attached to the back of Go2 and plugged into the onboard computer at the USB-C port. The signals are transmitted to a control station with a monitor. This setup allows us to work with Go2 similar to a desktop computer - the computer walks around in the environment and communicates with the control station wirelessly. Please see the images below for detailed information about the hardware setup.
File truncated at 100 lines [see the full file](https://github.com/jizhang-cmu/autonomy_stack_go2/tree/foxy-humble/README.md)