GO2 Robot Interface

Getting Help

Instructions for interfacing with the robot using Ubuntu 20.04 and ROS2 Foxy. This procedure should be followed after setting up and pairing with the GO2 Edu. Furthermore, all of the GO2’s functionality should be verified via the app.

_images/go2_lan_port.png

The Ethernet port at the back of the GO2 can be utilized for setting up communication via LAN.

GO2 Network Interface

For the first time, one needs to connect through a LAN cable to configure the robot’s network.

To create a static connection in your PC (not the robots), in Ubuntu go to Settings → Network then click on + and create a new connection.

  1. Change the connection to Manual in the IPv4 settings.

  2. Set the Address IP as 192.168.123.51 and the Netmask as 24.

  3. Click save and restart your network.

After a successful connection, check the host’s local IP by typing in the Host PC’s terminal:

ifconfig

Next, ping the robot:

ping 192.168.123.18

Access the robot via SSH:

ssh -X unitree@192.168.123.18

The default password is:

123

GO2 IP Addresses

Robot

IP Addresses

Password

GO2 MCU

192.168.123.161

-

GO2 External

192.168.123.18

123

Warning

Sometimes other networks can cause disruptions when connecting to the GO2. It is best to have only your connection to the robot active and all others inactive.

GO2 Network Verification

  • Firstly, connect to the GO2 as described in the Network section GO2 Network Interface

  • Secondly, open several ssh sessions into the go2 via

ssh -X unitree@192 .168.123.18

Note

Verify that the robot is processing information by typing the command in an ssh session.

ros2 topic echo /sportmodestate

Note

If data is displayed then it means that the drivers are running.

GO2 Visualization

You can view the GO2’s current state by typing in one of the ssh sessions:

ros2 launch go2_viz view_robot.launch.py

GO2 Tele-operation

You can teleoperate the GO2 by running the following in one of the ssh sessions:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

GO2 Mode Activation

Available GO2 Modes via ROS2 Services:

- normal_stand

- balance_stand

- recovery_stand

- stand_down

- stand_up

- gait_type_idle

- gait_type_trot

- gait_type_trot_running

- gait_type_climb

- gait_type_obstacle

- stretch

- wallow ( Robot goes on back , and can damage the Arm )

- damp

- sit

- rise_sit

- front_jump

- front_pounce

- front_flip

- stop_move

Available GO2 Functionalities via ROS2 Services:

- Light level : 0-10

- Volume level : 0-10

Note

Pressing the tab button on the keyboard will autocomplete the service request.

  • Example of activating mode

ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ recovery_stand
  • Example of standing down

ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ stand_down
  • Example of changing light level 0-10

ros2 service call /go2/light go2_srvs/srv/Go2Light light_level:\ 3
  • Example of activating mode

ros2 service call /go2/volume go2_srvs/srv/Go2Volume volume_level:\ 4

Note

At times the mode does not activate correctly such as stand, in those cases use the recovery stand.

GO2 Low-Level Control

The low-level control for GO2 can be directly used via Unitree’s provided example in their documentation. Running the provided qre-go2 driver with the low-level commands from Unitree examples should both work concurrently.

An example to test the low-level control is to suspend the go2.

  • Verify if the go2 bringup is running via:

sudo service ros2 status
  • Lie down the robot

ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ stand_down
  • Put motors in damp state

ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ damp
  • Run low-level example:

ros2 run go2_base go2_lowroscontrol

This will move the Rear Left leg of the GO2 with a force of 1N.m. An audible clicking sound can be heard if you try to move the GO2 left leg out of position.

Note

The GO2 low-level mode should only be used if you are familiar with low-level control, and gait planning and wish to create a new/custom controller for the GO2. The GO2 in low-level mode can easily be damaged if used incorrectly.

GO2 SLAM

To create a map for map-based navigation, the first step is to create a map of the environment.

_images/go2_slam_1.gif

Move the robot slowly when building the map

  • Launch:

ros2 launch go2_navigation slam.launch.py
  • You can begin mapping using the teleop at 0.2m/s with the keyboard and/or the provided Logitech controller. Once you are satisfied with your map you can export it by running the following command:

cd/home/unitree/ros2_ws/src/go2_navigation/maps/
ros2 run nav2_map_server map_saver_cli -f map_
  • Rebuild so that the maps can be found (This is required if the map name is not map otherwise it will directly work):

colcon build --symlink-install
  • Then source the environment:

source /home/$USER/ros2_ws/install/setup.bash

GO2 Odometric Navigation

To navigate without creating a map, you can simply launch the odom navi and give goals in RVIZ.

ros2 launch go2_navigation odom_navi.launch.py

GO2 Map Navigation

This will automatically take in the map created and save from the SLAM being map . If the map has been named something other, then in go2 navigation, the parameters have to be updated.

_images/go2_slam_1.png

Select the 2D Pose Estimate and click and drag to where the robot corresponds in the map/

_images/go2_slam_2.png

Once the robot is in the estimated location, it should self correct when the robot is moving as shown

  • Ensure the map is generated and available in the ros package (i.e. after the map is saved, you have placed and performed colcon build):

ros2 launch go2_navigation map_navi.launch.py

GO2 Drivers Startup (On by default)

Important

The go2 bringup system launch is not required if the go2 startup has been installed. This can be verified by typing in the terminal

sudo service ros2 status

If it is available and green, then do not launch the go2_bringup as it is running in the background.

Launch the go2 ros driver the communicates and publishes the state of the robot joints.

ros2 launch go2_bringup system.launch.py

GO2 Startup (Optional)

The GO2 ordinarily does not have a startup job unless otherwise specified (In this case the GO2 has a startup job). The GO2 launches the go2_bringup system.launch.py. To verify if the startup job is available in GO2. Run the command:

sudo service ros2 status

Warning

If an error such as Unit ros2.service could not be found., then it means that there is no startup installed.

  1. The red marker in the service indicates that the startup job has failed.

  2. Green marker indicates everything is working correctly.

  3. Grey marker indicates that the service has not started yet.

In case of red or grey marker, you may restart the service via:

sudo service ros2 restart

If you want to modify the upstart job or add other ROS launch files to it then it is recommended to add your changes to the main upstart file i.e. system.launch.py located in the go2_bringup package. Once done, save the file and run the following command to update startup job.

ros2 run go2_bringup startup_installer.py