Read and understand the launch file
Each command ros2 launch of M01 is a Python file in directory launch/ of the package. Reading it means knowing which node the command starts, with what parameters, and which configuration file it reads.
Can you point out: which file was created by node /fastlio2_body_to_base in lesson 1, and why x:=-6.0 passed to bringup.launch.py reached the robot spawn place.
Bringup: four nested files
atlas3d_bringup/launch/bringup.launch.py
- rviz2 if rviz:=true, configure rviz/sim3d.rviz
atlas3d_control/launch/controller.launch.py
- spawner joint_state_broadcaster
- spawner diff_drive_controller wheel_odom_tf:=false → add config/no_wheel_odom_tf.yaml
atlas3d_gazebo/launch/spawn_robot.launch.py
- ign gazebo via ros_gz_sim gz_sim.launch.py; headless:=true → -s --headless-rendering
- robot_state_publisher URDF = xacro atlas3d.control.xacro
- ros_gz_sim create spawn robot at SPAWN_POSES[world] or x/y/z/yaw, then exit
- ros_gz_bridge parameter_bridge config/gz_bridge.yaml
- imu_filter_node
Each file just IncludeLaunchDescription the file immediately below it and add your own part, do not rewrite. spawner and create are programs that finish running and exit, so they are not in ros2 node list. controller_manager, gz_ros2_control, diff_drive_controller live inside the Gazebo process (plugin gz_ros2_control in URDF).
Parameters go down to subfiles
ros2 launch atlas3d_bringup bringup.launch.py --show-args
Arguments (pass arguments as '<name>:=<value>'):
'world':
File world trong atlas3d_gazebo/worlds: empty, warehouse, corridor, ramp, terrain, parking (.sdf)
(default: 'terrain.sdf')
'headless': ...
'wheel_odom_tf': ...
'rviz': ...
bringup.launch.py only declares 4 parameters. But x:=-6.0 y:=2.0 z:=0.40 in lesson 3 can still place the robot in the middle of the slope, because the parameter of ros2 launch is common to the entire included file tree. spawn_robot.launch.py declares x, y, z, yaw and reads that value. See all parameters of subfile:
ros2 launch atlas3d_gazebo spawn_robot.launch.py --show-args
fastlio2.launch.py: one file, three modes
mode:= | Node | Configuration |
|---|---|---|
pgo (default) | lio_node, fastlio2_body_to_base, pgo_node | fastlio2_vlp16.yaml, fastlio2_pgo.yaml |
localization | lio_node, fastlio2_body_to_base, localizer_node, relocalize.py | fastlio2_vlp16.yaml, fastlio2_localizer.yaml + map_path, pose_file |
mapping | lio_node, fastlio2_body_to_base, voxel_map_node, static TF map → odom | Just to test FAST-LIO2 without PGO |
All three have lio_node and static TF body → base_footprint (code snippet below); just different from transmitter block map → odom. Therefore, do not run two modes at the same time: two nodes broadcast map → odom.
# src/atlas3d_slam/launch/fastlio2.launch.py
nodes = [Node(package="fastlio2", executable="lio_node", namespace="fastlio2",
parameters=[common, {"config_path": config}], output="screen"),
Node(package="tf2_ros", executable="static_transform_publisher",
name="fastlio2_body_to_base",
arguments=["--z", str(-BODY_HEIGHT), "--frame-id", "body", "--child-frame-id", "base_footprint"],
parameters=[common])]
namespace="fastlio2" is the reason the node is named /fastlio2/lio_node and the topic is /fastlio2/lio_odom.
navigation.launch.py: reuse localization
- Check
nav_map.yaml: not available or older thanmap.pcd, then runpcd_to_navmap.pyright during launch (statistics line in M01, article 4). - Include
fastlio2.launch.py mode:=localizationwithmap.pcd+poses.txtofmap_dir. - Adds
map_server(readnav_map.yaml),obstacle_filter(readtraversability.yaml), 4 Nav2 nodes (readnav2_params.yaml) andlifecycle_manager.
This is the same way as bringup: don't copy the localization part but include it, you should edit the localizer in one place and both commands will change at the same time.
Configuration file according to node
| File | Node reads | Purpose |
|---|---|---|
atlas3d_description/config/dimensions.yaml | (xacro, when launch) → robot_state_publisher | All robot sizes |
atlas3d_gazebo/config/gz_bridge.yaml | ros_gz_bridge | Which topic is connected to Gazebo ↔ ROS |
atlas3d_control/config/diff_drive_controller.yaml | diff_drive_controller | Wheel distance, maximum speed |
atlas3d_slam/config/fastlio2_vlp16.yaml | lio_node | Topic sensor, LiDAR–IMU, gravity_align |
atlas3d_slam/config/fastlio2_pgo.yaml | pgo_node | Keyframe, closed search loop |
atlas3d_slam/config/fastlio2_localizer.yaml | localizer_node | Detection range ±1 m ±30°, ICP |
atlas3d_navigation/config/traversability.yaml | obstacle_filter, pcd_to_navmap.py | Slope ≤ 15°, steps ≤ 7 cm |
atlas3d_navigation/config/nav2_params.yaml | Nav2 | Footprint, costmap, traction speed |
After editing the file in src/, you must re-install it with colcon build (or build with --symlink-install): launch reads the version installed in install/.