This repository contains the complete ROS 2 workspace for Unitree Go1 robots, including sensor drivers and the ros1_bridge.
New users experimenting with physical robots should read section Using Docker for Development on Physical Robots.
Follow the steps below to install this repository:
-
Clone the git repository. Be sure to include the
--recurseoption.git clone --recurse git@github.com:NU-IDEAS-Lab/robot_go1.git
-
Source ROS 2.
source /opt/ros/humble/setup.bash -
Build the workspace.
cd ./robot_go1/ colcon build -
Source the newly-built workspace.
source ./install/setup.bash
The Go1 software should now be ready for use by other ROS 2 packages. You may wish to source the robot_go1 workspace automatically so that it does not need to be re-sourced in every new terminal.
Docker may be used for easy deployment of the robot software.
To manually build:
docker buildx build --platform=linux/arm64 -t robot:arm64 .
To pull pre-built image automatically from the container repository:
docker pull ghcr.io/nu-ideas-lab/robot_go1:latest
To run the built Docker container:
docker run --privileged --net=host -v /dev:/dev --rm -it ghcr.io/nu-ideas-lab/robot_go1:latest /bin/bash
The robot_configuration repository may be used for automatic deployment of Docker images to the robots. Follow the instructions at that repository to set up, and then run the following command from your computer:
ansible-playbook -i ./inventory/ ./deploy-software.yml -l YOUR_ROBOT_NAMEThe latest robot production (robot) and development (robot_dev) containers will then be deployed to the robot, along with the robot_ros1_bridge container which facilitates communication with the Unitree cameras.
This is a very basic workflow. Please feel free to modify/improve it.
-
Clone the repository onto your development computer.
-
Copy the repository to the
/home/ideas/robot_go1folder on the robot. See the VS Code Development Workflow section below for an automatic way to do this. -
We recommend to kill any currently-running robot Docker containers on the robot and restarting the
robot_ros1_bridgecontainer:docker kill robot robot_dev docker restart robot_ros1_bridge -
Start the Docker container. If you used the Automatic Deployment for Physical Robots, run the following:
docker start -i robot_dev
If not, you may achieve the same effect manually:
docker run --privileged --net=host -v /dev:/dev -v ./robot_go1:/opt/robot_dev --rm -it ghcr.io/nu-ideas-lab/robot_go1:latest /bin/bash
Both commands should be equivalent, though the first is slightly easier to remember.
-
Inside the Docker container, change to the
/opt/robot_devdirectory:cd /opt/robot_dev -
Build the robot software:
colcon build
-
Source the newly-built robot software:
source /opt/robot_dev/install/setup.bash -
Run the robot software:
ros2 launch robot_go1 robot.launch.yaml
We provide a VS Code workspace configuration which greatly simplifies development on physical platforms. Using the recommended SFTP extension, one can easily upload changes to the physical robots.
First, select the robot to which you wish to upload by pressing Ctrl+Shift+P and running the SFTP: Set Profile command. You should see a list of robots. Select the one you are using.
If you have never uploaded code to the robot before, or are unsure of the robot state, right-click on the robot_go1 folder in VS Code's left-hand pane and select Sync Local -> Remote.
After the initial synchronization, files will be uploaded automatically to the robot when you save them.