How we see what the robots see: recording rosbags and viewing them in Foxglove.
M20 Pro
Root shell
To record a bag with the LiDAR points and the other topics you need, you have to work from a root shell with Lightning-LM’s DDS profile. As plain user, /LIDAR/POINTS shows no publishers and the bag gets no LiDAR.
# on AOS
sudo bash
source /opt/robot/scripts/setup_ros2.sh
export ROS_DOMAIN_ID=0 ROS_LOCALHOST_ONLY=0 RMW_IMPLEMENTATION=rmw_fastrtps_cpp \
FASTRTPS_DEFAULT_PROFILES_FILE=/home/user/lightning-lm/config/fastdds.xml
ros2 daemon stop
timeout 10 ros2 topic hz /LIDAR/POINTS # expect ~10 Hz
Foxglove
Live Foxglove is limited on the M20: foxglove_bridge doesn’t support ROS 2 Foxy, and rosbridge is fine for poses and status but too slow for live point clouds over Wi-Fi. To see the LiDAR, record a bag and open it in Foxglove on your laptop.
Rosbags
Recording. From the root shell above:
mkdir -p /home/user/bags && cd /home/user/bags
ros2 bag record -o run1 /LIDAR/POINTS /IMU /IMU_YESENSE \
/LIO_ODOM /LIO_ODOM_HIGH_FREQUENCY /ODOM /tf
chown -R user:user /home/user/bags/run1 # so scp works as user
| Topic | What it is |
|---|---|
/LIDAR/POINTS |
Raw LiDAR cloud, about 10 Hz |
/IMU, /IMU_YESENSE |
The two IMUs, both sensor_msgs/Imu. Lightning-LM’s M20 preset uses /IMU |
/LIO_ODOM, /LIO_ODOM_HIGH_FREQUENCY |
The firmware’s own LiDAR odometry |
/ODOM |
The firmware’s localization output |
/tf |
Transforms. There is no /tf_static, and the firmware already publishes map → base_link |
- Stopping: press Ctrl+C once and wait for the prompt. A second Ctrl+C or closing the terminal leaves a corrupt
.db3(“database disk image is malformed”). A clean bag hasmetadata.yamlnext torun1_0.db3. - Recording everything:
ros2 bag record -afails because some topic types (for example somedrddsmessages) have no installed definitions. Filter the topic list againstros2 interface packagesfirst, and expect several GB per minute. - Size: raw LiDAR is hundreds of MB per minute. Check space with
df -h.
Copying and playing back:
# on your laptop
mkdir -p ~/m20_runs && cd ~/m20_runs
rsync -aP user@10.21.41.1:/home/user/bags/run1/ ./bag_run1/
# play back on the laptop only, kept off the robot network
source /opt/ros/humble/setup.bash
export ROS_LOCALHOST_ONLY=1
ros2 bag play ~/m20_runs/bag_run1 --rate 1.0
In Foxglove, open bag_run1/run1_0.db3, add a 3D panel and enable /LIDAR/POINTS and /LIO_ODOM. Foxglove can’t decode drdds/msg/* topics from a Foxy bag.
Safety rules
- Leave the firmware services (
lio-perception,rslidar,hsLidar,rl_deploy, NOS localization and planner) running. Don’t restart them while the robot is standing:lio-perceptionfeeds the height map used for walking. - Never run
apt upgradeon the robot. Install packages only with--no-remove, after reviewing the list. - Never run
ros2 bag playon the robot. It would publish old IMU, LiDAR and TF data into the live system.
X30 Pro
On the X30 we drive the vendor navigation stack through robot_server’s protocol, using our route_manager and the Route Control Foxglove panel. Mapping and localization are started from the SLAM Control panel. See X30 Pro for what these do.
X30 command reference to come.