robotUnitree Go2 Quadruped

Unitree Go2 EDU Quadruped (dog)

OM1 can control a Unitree Go2 EDU out of the box. This has been tested on Nvidia Orin, Mac Mini, and current (silicon) Mac laptops.

Step 1 - Establishing Ethernet and DDS Connectivity

Connect the Unitree Go2 EDU to your development machine with an Ethernet cable. Open the network settings and find the network interface that is connected to the Go2 EDU. In the IPv4 settings, change the IPv4 mode to manual, set the address to 192.168.123.99, and set the mask to 255.255.255.0. After completion, click apply (or equivalent) and wait for the network to reconnect. Provide the name of the network adapter in the "unitree_ethernet": "en0" entry in the unitree_go2.config file.

Then, install CycloneDDSarrow-up-right. CycloneDDS works on Mac, Linux, and PC. Run:

git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd cyclonedds && mkdir build install && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DBUILD_EXAMPLES=ON
cmake --build . --target install

Next, set CYCLONEDDS_HOME, CMAKE_PREFIX_PATH, and CYCLONEDDS_URI to the correct values for your computer. Example settings for a typical Mac installation are provided below. You should add these paths to your environment via your .zshrc or equivalent.

export CYCLONEDDS_HOME=$HOME/Documents/GitHub/cyclonedds/install

export CMAKE_PREFIX_PATH=$HOME/Documents/GitHub/cyclonedds/install

export CYCLONEDDS_URI='
<CycloneDDS>
  <Domain>
    <General>
      <Interfaces>
        <NetworkInterface name="en0" priority="default" multicast="default" />
      </Interfaces>
    </General>
    <Discovery>
      <EnableTopicDiscoveryEndpoints>true</EnableTopicDiscoveryEndpoints>
    </Discovery>
  </Domain>
</CycloneDDS>'

Then, compile and run the listtopics example:

On Mac, you might need to allow incoming connections in the popup the first time you run listtopics.

Running listtopics should result in an extensive data dump of available topics:

Step 2 - Add the Python CycloneDDS module

Add the dds python module to your code base: uv pip install -r pyproject.toml --extra dds.

Step 3 - Connect an Game Controller

On Mac, if you are using an Xbox controller, make sure that it is running the most recent firmware, otherwise you will be able to pair but not connect to the controller. You will need a PC with Xbox Accessories to update the Xbox controller's firmware. Many Mac OS updates hose support for the Xbox controller, which is then fixed (after some delay) via an Xbox firmware update.

On Mac, you will need to install hidapi:

NOTE: There is a bug on Mac when installing packages with brew - some libraries cannot be found by uv. If you get errors such as Unable to load any of the following libraries:libhidapi-hidraw.so, set export DYLD_FALLBACK_LIBRARY_PATH=$HOMEBREW_PREFIX/lib in your .zshenv or equivalent.

On Linux, install hidapi like this:

Accessing Unitree Data

For debugging, you can access Unitree data as follows:

Front video feed:

Front video single image:

Lowstate system/joint data:

Lidar:

Note - the internal Go2 LIDAR is currently not used - a separate RPLIDAR mounted to the top of the dog's head is used instead.

Minimal Quadruped Functionality

In this configuration, the quadruped observes its environment, listens and speaks, but there is no AI-controlled movement. You can manually control the dog's movements with an game controller.

Run

Press:

  • A to stand up

  • B to sit down

  • The D-pad allows you to steer the quadruped.

See the Quadruped Configurations for additional configurations.

Unitree Go2 EDU Common Problems

Channel factory init error: If you see a channel factory init error, then you have not set the correct network interface adapter - the one you want to use is the network interface adapter on your development machine - the computer you are currently sitting in front of that is plugged into the Unitree quadruped (which has its own internal RockChip computer and network interface, which is not relevant to you right now). The Ethernet adapter - such as eno0 or en0 - needs to be set in the "unitree_ethernet": "en0" entry in the unitree_go2.config file.

The CycloneDDS library could not be located: You did not install CycloneDDS (see above), or, you did not provide a path to the /install, via export CYCLONEDDS_HOME=$HOME/Documents/GitHub/cyclonedds/install or equivalent.

"nothing is working" There are dozens of potential reasons "nothing is working". The first step is to test your ability to ping the quadruped motion control computer:

Assuming you can ping the robot, then test the CycloneDDS middleware (see STEP 1). Once you see data flowing, then the rest of the system should work.

Last updated

Was this helpful?