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
Foxglove
Both the navigation and perception computers run a Foxglove bridge, started at boot. Because the two run separate ROS masters, each bridge shows only its own computer’s topics; open two connections to see both.
| Computer | Connect to | Shows |
|---|---|---|
| Navigation | ws://192.168.1.106:8766 |
Map, localization, global plan and path tracker, routes (/route/*), SLAM Control |
| Perception | ws://192.168.1.105:8766 |
Merged LiDAR, elevation map, safety_node, terrain_gait and nav3d |
Port 8765 is already taken by vendor software on both computers, so the bridges use 8766. Don’t stop the vendor node to free it.
Our layouts are in the repository under foxglove/layouts/, and our panels under foxglove/extensions/: SLAM Control (x30.slam-control-0.1.0.foxe) and Route Control (x30.route-control-0.2.0.foxe). Install a .foxe file by dragging it onto the Foxglove window.
Rosbags
Record on the perception computer, where the LiDAR, leg odometry and gait topics all are:
mkdir -p ~/bags && cd ~/bags
rosbag record --lz4 --split --duration=60 -o terrain \
/livox/lidar /leg_odom /imu/data /robot_gait_state /handle_state \
/cmd_vel /cmd_vel_corrected /vel_source_state /set_gait \
/terrain_gait/status /terrain_gait/hold_level
- Size: about 0.9 GB per minute, most of it LiDAR;
--split --duration=60writes one file per minute. - Keep each bag to one situation (standing, walking at an obstacle, stairs up, stairs down, a ramp), 30–60 s, and note when anything went wrong.
- Copying:
rsync -avP ysc@192.168.1.105:~/bags/ ~/x30_bags/, then open the.bagfiles in Foxglove.
Safety rules
- Leave the vendor’s software under
~/jy_cogand~/jy_exerunning and unchanged. Copies of any vendor config we deliberately change go in our repository’sconfig/, with the reason. - Never play a bag back on the robot. It would publish old LiDAR, odometry and TF into the live system.
- Only one thing should command the robot at a time: don’t run a vendor navigation task while our
nav3dis driving.