Skip to content

ACRE SLAM Go2 Packge

Nicholas Sutton edited this page Jul 22, 2026 · 17 revisions

Introduction

The acre_slam package is a ROS2 SLAM package for the Unitree Go2. Before using acre_slam, please familiarize yourself with the basics of using the Unitree Go2.

Resources

Our SLAM stack uses the following libraries:

The following resources are helpful for understanding the sensors and how they interact with the Unitree SDK:

Go2 Mid360 LiDAR Config

Using the Mid360 LiDAR requires configuration before it can be used.

  1. Connect to the Go2 via Ethernet and disable obstacle avoidance using the controller
  2. Follow the steps in Go2 Networking Configuration and connect to the NVIDIA Orin using ssh

Warning

When connecting to the NVIDIA Orin, you will be prompted to select a ROS2 version. If you are using ACRE_SLAM press 1 for foxy. If you are using the Unitree SLAM packages, sourcing a ROS2 version will conflict with the SLAM packages used by the Go2. Hit the ENTER key to skip this.

  1. Check that the data reception and transmission buffer sizes are set correctly:
cat /etc/sysctl.conf | grep -E "rmem_max|wmem_max"
# The values should be set to
# net.core.rmem_max=52428800
# net.core.wmem_max=52428800

If these values are not set run the following commands:

sudo su
echo "net.core.rmem_max=52428800" >> /etc/sysctl.conf
echo "net.core.wmem_max=52428800" >> /etc/sysctl.conf
sysctl -p

Livox SDK and ROS2 Driver

Note

If you are using one of the ACRE Go2s, the Livox SDK and ROS2 Driver are likely already installed.

Installation

  1. Install the Livox SDK2. We recommend installing the SDK in ~/Livox-SDK2
  2. Install the Livox ROS2 Driver. We recommend installing the sdk in ~/livox_ws/src/livox_ros_driver2
  3. Build the ROS2 package for ROS2 Foxy
source /opt/ros/foxy/setup.sh
./livox_ws/src/livox_ros_driver2/build.sh ROS2

MID360 LiDAR Configuration

Edit ~/livox_ws/src/livox_ros_driver2/config/MID360_config.json to match the following configuration

{
  "lidar_summary_info" : {
    "lidar_type": 8
  },
  "MID360": {
    "lidar_net_info" : {
      "cmd_data_port": 56100,
      "push_msg_port": 56200,
      "point_data_port": 56300,
      "imu_data_port": 56400,
      "log_data_port": 56500
    },
    "host_net_info" : {
      "cmd_data_ip" : "192.168.123.18",
      "cmd_data_port": 56101,
      "push_msg_ip": "192.168.123.18",
      "push_msg_port": 56201,
      "point_data_ip": "192.168.123.18",
      "point_data_port": 56301,
      "imu_data_ip" : "192.168.123.18",
      "imu_data_port": 56401,
      "log_data_ip" : "",
      "log_data_port": 56501
    }
  },
  "lidar_configs" : [
    {
      "ip" : "192.168.123.20",
      "pcl_data_type" : 1,
      "pattern_mode" : 0,
      "extrinsic_parameter" : {
        "roll": 0.0,
        "pitch": 0.0,
        "yaw": 0.0,
        "x": 0,
        "y": 0,
        "z": 0
      }
    }
  ]
}

ACRE SLAM

Installation

  1. Install the acre_slam package
  2. Build and run the Docker container:
docker build -t acre_slam .
./run.bash
  1. If you wish to turn off the Go2's onboard LiDAR run:
# Turn the LiDAR off
ros2 topic pub /utlidar/switch std_msgs/msg/String "data: 'OFF'" --once

# Turn it back on
ros2 topic pub /utlidar/switch std_msgs/msg/String "data: 'ON'" --once

Start the Livox Driver

  1. Source livox_ws
cd livox_ws
source install/setup.bash
  1. Run the following command in the Go2s shell session:
ros2 launch livox_ros_driver2 msg_MID360_launch.py   # This is the message type consumed by acre_slam
ros2 launch livox_ros_driver2 rviz_MID360_launch.py  # For viewing the LiDAR scan in rviz only 

FastLIO2

  1. Confirm that acre_slam/config/fast_lio2/mid360.yaml matches the following:
extrinsic_est_en: false      # true: enable the online estimation of IMU-LiDAR extrinsic
extrinsic_T: [ -0.011, -0.02329, 0.04412 ]
extrinsic_R: [ -0.9743701, 0., 0.2249511,
                    0.   , 1.,      0., 
               -0.2249511, 0., 0.9743701]
  1. Run the following command:
ros2 launch fast_lio mapping.launch.py config_file:=/workspace/src/acre_slam/config/fast_lio2/mid360.yaml 

After you are done mapping, you can evoke the /map_save service to save your map as a PCL file. The file will be save to /opt/fastlio_ws/src/FAST_LIO/PCD/

ros2 service call /map_save std_srvs/srv/Trigger {}

Note

FastLIO2 produces two frames. camera_init corresponds to a fixed map frame. body corresponds to a moving odometry frame.

Unitree SLAM Packages

If you would prefer to use the provided Unitree SLAM packages, please configure these settings

  1. Give permission to execute the needed binaries
sudo chmod 777 -R /unitree/module/unitree_slam
  1. Check the SLAM configuration files
cat /unitree/module/unitree_slam/config/slam_interfaces_server_config/param.yaml

The settings under the Go2 section should match our Go2's configuration. The most important settings to check are:

lidar_type: "mid360"
lidar_ysn: "..." # This value can be found by scanning the left QR code on the LiDAR
lidar_ip: "192.168.123.20"
cat /unitree/module/unitree_slam/config/gridmap_config/config.yaml

check that T_Dog2lidar is set to the following value

T_Dog2lidar: [0.0, 0.0, 0.0, 0.0, 0.226, 0.0]
  1. To activate the Mid360 LiDAR driver, run:
cd /unitree/module/unitree_slam/bin
./mid360_driver
# If you encounter a segfault, try running:
# LD_LIBRARY_PATH=/opt/unitree_robotics/lib:$LD_LIBRARY_PATH ./mid360_driver

Clone this wiki locally