Developed as part of the UC Berkeley Master of Engineering capstone project in Mechanical Engineering.
This repository contains a ROS 2 Humble control stack for the Unitree Go2, including:
- a Streamlit telemetry dashboard
- stand-up initialization
- an InEKF-based state estimator path
- an RL locomotion controller
- arm feedback parsing
- direction intent estimation
- Unitree SDK and description dependencies as submodules
The dashboard can start and stop:
- the main control stack
- the Foxglove bridge
Clone with submodules:
git clone --recurse-submodules https://github.com/elijah-waichong-chan/go2-control-stack| Submodule Path | URL |
|---|---|
ros2_ws/src/core/go2_odometry |
https://github.com/elijah-waichong-chan/go2_odometry.git |
ros2_ws/src/vendor/unitree_ros2 |
https://github.com/unitreerobotics/unitree_ros2 |
ros2_ws/src/descriptions/unitree_description |
https://github.com/inria-paris-robotics-lab/unitree_description.git |
ros2_ws/src/vendor/inekf |
https://github.com/elijah-waichong-chan/invariant-ekf.git |
Build the image:
sudo docker build -t go2-ros2-control .Start and run the container:
sudo docker run -d \
--net=host \
--mount type=bind,src="$(pwd)",dst=/home/go2-control-stack \
--name go2-ros2-control \
go2-ros2-control sleep infinityOpen a shell in the container:
sudo docker exec -it <container_id> bashTo start an existing container later:
sudo docker start go2-ros2-controlUseful Docker commands:
sudo docker image ls
sudo docker psInside the container or on a ROS 2 Humble host:
cd /home/go2-control-stack/ros2_ws
source /opt/ros/humble/setup.bash
colcon build --parallel-workers 4 --cmake-clean-cache
source install/setup.bashLaunch the dashboard:
cd /home/go2-control-stack/ros2_ws
source /opt/ros/humble/setup.bash
source /home/go2-control-stack/ros2_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
source install/setup.bash
ros2 launch locomotion_controller dashboard.launch.pyThen:
- Open the dashboard on
http://localhost:8501 - Click
Start Control Stackto launch the control stack - Optionally click
Start Foxglove Bridgeto launch Foxglove socket node
ROS Bag collection
ros2 bag record -s mcap -o "direction_estimator_bag_$(date +%Y%m%d_%H%M%S)" /data/push_event /lowstate /arm_angles| Package | Description |
|---|---|
arm_controller |
Parses /arm_Feedback, publishes /arm_angles, and exposes arm parser status. |
intent_estimator |
Direction intent estimation nodes using 1-D CNN models. |
estimator_bridge |
Converts estimator outputs into the /qdq_est format used by this stack. |
go2_msgs |
Custom ROS 2 message definitions used across the stack. |
locomotion_controller |
Stand-up initialization, RL policy control, safety stop handling, and launch files. |
telemetry_dashboard |
Streamlit dashboard for module status, topic monitoring, and launch controls. |
| Package | Description |
|---|---|
go2_odometry |
Forked odometry and state-estimation package, including InEKF runtime nodes. |
inekf |
Invariant EKF library dependency used by the estimator path. |
unitree_arm |
Unitree arm interfaces and related dependencies. |
unitree_description |
Robot description package used by the odometry and state publisher path. |
unitree_ros2 |
Unitree ROS 2 SDK and example packages. |