GO2 Robot Interface =================== 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. .. figure:: media/figures/go2_lan_port.png :width: 100% :align: center The Ethernet port at the back of the GO2 can be utilized for setting up communication via LAN. .. _static-network-connection: 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: .. code:: bash ifconfig Next, ping the robot: .. code:: bash ping 192.168.123.18 Access the robot via SSH: .. code:: bash ssh -X unitree@192.168.123.18 The default password is: .. code:: bash 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 :ref:`static-network-connection` • Secondly, open several ssh sessions into the go2 via .. code:: bash ssh -X unitree@192 .168.123.18 .. note:: Verify that the robot is processing information by typing the command in an ssh session. .. code:: bash 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: .. code:: bash 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: .. code:: bash 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 .. code:: bash ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ recovery_stand • Example of standing down .. code:: bash ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ stand_down • Example of changing light level 0-10 .. code:: bash ros2 service call /go2/light go2_srvs/srv/Go2Light light_level:\ 3 • Example of activating mode .. code:: bash 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: .. code:: bash sudo service ros2 status • Lie down the robot .. code:: bash ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ stand_down • Put motors in damp state .. code:: bash ros2 service call /go2/modes go2_srvs/srv/Go2Modes request_data:\ damp • Run low-level example: .. code:: bash 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. .. figure:: media/gifs/go2_slam_1.gif :width: 100% :align: center Move the robot slowly when building the map • Launch: .. code:: bash 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: .. code:: bash cd/home/unitree/ros2_ws/src/go2_navigation/maps/ .. code:: bash 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): .. code:: bash colcon build --symlink-install • Then source the environment: .. code:: bash 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. .. code:: bash 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. .. figure:: media/figures/go2_slam_1.png :width: 100% :align: center Select the **2D Pose Estimate** and click and drag to where the robot corresponds in the map/ .. figure:: media/figures/go2_slam_2.png :width: 100% :align: center 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**): .. code:: bash 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 .. code:: bash 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. .. code:: bash 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: .. code:: bash 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: .. code:: bash 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. .. code:: bash ros2 run go2_bringup startup_installer.py GO2 Intel Realsense D435i ========================= • To launch the Realsense d435i, launch: .. code:: bash ros2 launch go2_depth_camera realsense_d435i.launch.py • By default the Realsense D435i is off. • The launch file is configured to enable continuous depth stream information from the Realsense d435i without lag. To further change parameters, simply change the configuration in the: .. code:: bash go2_depth_camera/launch/realsense_d435i.launch.py GO2 Intel Realsense D405 ======================== .. Note:: If launching both realsense cameras. Launch them in separate terminals with 10-second delay. Ensure that in their launch files, their serial numbers are assigned. • To launch the Realsense D405, launch: .. code:: bash ros2 launch go2_depth_camera realsense_d405.launch.py • By default the Realsense D405 is off. • The launch file is configured to enable continuous depth stream information from the Realsense D405 without lag. To further change parameters, simply change the configuration in the .. code:: bash go2_depth_camera/launch/realsense_d405.launch.py GO2 Mid360 Lidar ================ • To activate the Livox Mid360 Lidar, launch: .. code:: bash ros2 launch go2_livox system.launch.py • By default the Livox Mid360 is off.