diff --git a/robot/quadruped/go2.md b/robot/quadruped/go2.md index 2215ad7..cfffd7d 100644 --- a/robot/quadruped/go2.md +++ b/robot/quadruped/go2.md @@ -46,6 +46,7 @@ Go2 Edu has 1 built-in computer and 1 onboard computer (expansion dock module): * **Go2 App, Robot Features, Tutorial Videos, Manuals**: [Go2 Features](https://www.unitree.com/app/go2) * **Other Information**: [URDF/CAD](https://support.unitree.com/home/en/developer/Obtain%20SDK) * **Tutorials Page**: [Diagnostic Guide](/tutorial/intro) +* **Simultaneous Localization and Mapping Guide**: [Unitree SLAM Guide](/software/slam/go2_slam) ## 4. FAQ diff --git a/sidebars-software.ts b/sidebars-software.ts index 6fdc681..648af31 100644 --- a/sidebars-software.ts +++ b/sidebars-software.ts @@ -17,7 +17,14 @@ const sidebarsSoftware: SidebarsConfig = { 'toolbox/assisted_driving_toolbox', ], }, + { + type: 'category', + label: 'Unitree Slam Guide', + items: [ + 'slam/go2_slam', + ], + }, ], }; -export default sidebarsSoftware; \ No newline at end of file +export default sidebarsSoftware; diff --git a/software/slam/go2_slam.md b/software/slam/go2_slam.md new file mode 100644 index 0000000..21ce3f6 --- /dev/null +++ b/software/slam/go2_slam.md @@ -0,0 +1,212 @@ +--- +sidebar_position: 1 +--- + +# Go2 & Go2-W + +## 1. Setup + +Before jumping into SLAM, ensure that all required configurations are set up on the User PC. + +### 1.1 What You Need + +- **User PC** running Ubuntu 20.04 or 22.04 + - Ubuntu 22.04 is recommended. + - A laptop is recommended. + - You may refer to the [Ubuntu Installation Guide](https://ubuntu.com/tutorials/install-ubuntu-desktop). +- **ROS2 Foxy or Humble** installed + - Humble is recommended. + - You may refer to the [ROS2 Humble Installation Guide](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debs.html). + - After installing ROS2, in the terminal, run **`export ROS_DOMAIN_ID=0`**. +- **Unitree Software Development Kit** installed and set up + - You may refer to the [Unitree_SDK_Go2 Installation Guide](https://support.unitree.com/home/en/developer/Quick_start) or the [Unitree_SDK_Go2-W Installation Guide](https://support.unitree.com/home/en/Go2-W_developer/Quick_Start). +- **Unitree ROS2 Services Interface** installed + - You may refer to the [ROS2 Services Interface Installation Guide](https://support.unitree.com/home/en/developer/ROS2_service). + - Ensure Cyclone DDS is used as the middleware. +- **Ethernet cable** + - Used to connect the laptop to the Robot's PC. + - A cable longer than 5 meters is recommended. + +### 1.2 Additional Preparation + +- **Payload Installation** + - You may refer to the [Payload Installation Guide](https://support.unitree.com/home/en/developer/Payload). + - Make sure the Expansion Dock and External LiDAR (XT16 or MID-360) are installed properly. +- **SLAM Service Expansion Dock Module Update Package** + - You may refer to the [Expansion Dock Configuration Guide](https://support.unitree.com/home/en/developer/module_update). + +### 1.3 Notes + +- The RViz configuration files can be found in the **Expansion Dock Module Update Package** installed in the previous steps. +- **Robot's PC details:** + - Username: `unitree` + - Password: `123` + - IP address: `192.168.123.18` +- Secure Shell into the Robot's PC by running **`ssh unitree@192.168.123.18`** in the terminal. + - When prompted, enter the password above. + - Select **1** when prompted for the ROS version. +- If you encounter issues when running commands in the terminal, try adding **`sudo`** at the front (e.g. **`sudo nano /etc/default/grub`**). +- If you are using **ROS2 Humble** instead of **ROS2 Foxy**, replace any references to *Foxy* with *Humble* when following the steps above. + +--- + +## 2. Configuration + +### 2.1 Wired Connection + +- Make sure the User PC is connected to the Expansion Dock on the Go2/Go2-W as shown below. + + +- Ensure that the network interface connected to the robot is configured with the following settings. + + +- In the terminal: + - Verify the connection by running: + - **`ping 192.168.123.18`** for the Robot's PC + - **`ping 192.168.123.20`** for the External LiDAR + - **`ping 192.168.123.161`** for the Motion Control PC + - Verify the ROS2 setup by running: + - **`source unitree_ros2/setup.sh`** + - **`ros2 topic list`** + - Expected output: +  + +--- + +### 2.2 Expansion Dock Configuration for SLAM + +- Check that the Power Mode of the Robot's PC is set to 0:MAXN by passing the command **sudo /usr/sbin/nvpmodel -q**. If it is not the desired Power Mode, then pass the command **sudo /usr/sbin/nvpmodel -m 0** to set it. +- Modify the Maximum Receive Buffer Size in the cyclonedds by passing the following command to the Robot's PC: + - **`sudo su`** + - **`echo "net.core.rmem_max=52428800" >> /etc/sysctl.conf`** + - **`echo "net.core.wmem_max=52428800" >> /etc/sysctl.conf`** + - **`sysctl -p`** + - **`exit`** + - **`sudo chmod 777 -R /unitree/module/unitree_slam`** +- Make sure you have the [Unitree Software Development Kit](#12-additional-preparation) installed. +- Make sure the [SLAM Service Expansion Dock Module Update Package](#12-additional-preparation) is installed. +- In the User PC, clone the Unitree Software Development Kit repository. + - **`sudo git clone https://github.com/unitreerobotics/unitree_sdk2.git`** +- Transfer the Software Development Kit from User PC to the Robot's PC. + - **`scp -r ~/unitree_sdk2 unitree@192.168.123.18:/home/unitree/`** +- Clean, rebuild and install Unitree Software Development Kit in the Robot’s PC. + - **`cd /home/unitree/unitree_sdk2`** + - **`sudo mkdir -p build && cd build`** + - **`sudo cmake ..`** + - **`sudo make install`** +- Build the SLAM Example + - **`cd /unitree/module/unitree_slam/example`** + - **`sudo mkdir -p build && cd build`** + - **`sudo cmake -Dunitree_sdk2_DIR=/home/unitree/unitree_sdk2/build/unitree_sdk2 ..`** + - **`sudo make`** + +### 2.3 LiDAR Parameter Configuration + +- Check for the model of the external LiDAR installed. +
+ Livox LiDAR Mid-360
+
+ Hesai XT16 LiDAR
+