Skip to content

Repository files navigation

robot_go1

This repository contains the complete ROS 2 workspace for Unitree Go1 robots, including sensor drivers and the ros1_bridge.

Build Status Dependencies Build Date

New users experimenting with physical robots should read section Using Docker for Development on Physical Robots.

Installation

Follow the steps below to install this repository:

  1. Clone the git repository. Be sure to include the --recurse option.

    git clone --recurse git@github.com:NU-IDEAS-Lab/robot_go1.git
  2. Source ROS 2.

    source /opt/ros/humble/setup.bash
  3. Build the workspace.

    cd ./robot_go1/
    colcon build
  4. 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 Installation & Usage

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

Automatic Deployment for Physical Robots

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_NAME

The 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.

Using Docker for Development on Physical Robots

This is a very basic workflow. Please feel free to modify/improve it.

  1. Clone the repository onto your development computer.

  2. Copy the repository to the /home/ideas/robot_go1 folder on the robot. See the VS Code Development Workflow section below for an automatic way to do this.

  3. We recommend to kill any currently-running robot Docker containers on the robot and restarting the robot_ros1_bridge container:

    docker kill robot robot_dev
    docker restart robot_ros1_bridge
  4. 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.

  5. Inside the Docker container, change to the /opt/robot_dev directory:

    cd /opt/robot_dev
  6. Build the robot software:

    colcon build
  7. Source the newly-built robot software:

    source /opt/robot_dev/install/setup.bash
  8. Run the robot software:

    ros2 launch robot_go1 robot.launch.yaml

VS Code Development Workflow

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.

About

This repository holds the ROS 2 base workspace for Unitree Go1 platforms.

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages