Atlas Robotics
Lesson 2/6 · about 25 min

Node and topic: how programs exchange data

Three commands to know what the system has: list nodes, see what a node transmits and receives, see if a topic transmits or receives.

The node list matches the diagram in lesson 0, and you can answer for yourself: What does /fastlio2/lio_node receive, what does it transmit.

ros2 node list

Terminal 1

ros2 launch atlas3d_bringup bringup.launch.py world:=ramp.sdf wheel_odom_tf:=false rviz:=false

Terminal 2

ros2 launch atlas3d_slam fastlio2.launch.py rviz:=false

Terminal 3

ros2 node list
/controller_manager
/diff_drive_controller
/fastlio2/lio_node
/fastlio2_body_to_base
/gz_ros2_control
/imu_filter_node
/joint_state_broadcaster
/pgo/pgo_node
/robot_state_publisher
/ros_gz_bridge

10 nodes: 7 of bringup, 3 of SLAM. Gazebo is not on the list because it is not a ROS node; it talks to ROS via ros_gz_bridge (sensor) and gz_ros2_control (wheel). A name with a prefix like /fastlio2/ is namespace, set by the launch file; The topic of that node also carries this prefix (/fastlio2/lio_odom).

With navigation.launch.py the list increases to 25 nodes. There are sub-nodes created by the library, not the ones you run: transform_listener_impl_… (TF listener in Python node), bt_navigator_navigate_to_pose_rclcpp_node, and global_costmap/local_costmap run inside process planner_server/controller_server.

ros2 node info

ros2 node info /fastlio2/lio_node
/fastlio2/lio_node
  Subscribers:
    /clock: rosgraph_msgs/msg/Clock
    /imu/data: sensor_msgs/msg/Imu
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /velodyne_points: sensor_msgs/msg/PointCloud2
  Publishers:
    /fastlio2/body_cloud: sensor_msgs/msg/PointCloud2
    /fastlio2/lio_odom: nav_msgs/msg/Odometry
    /fastlio2/lio_path: nav_msgs/msg/Path
    /fastlio2/world_cloud: sensor_msgs/msg/PointCloud2
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /rosout: rcl_interfaces/msg/Log
    /tf: tf2_msgs/msg/TFMessage
  Service Servers:
    /fastlio2/lio_node/describe_parameters: ...
    (6 service tham số, node nào cũng có)

Read out: FAST-LIO2 only requires two sensors (/velodyne_points, /imu/data) and a simulation clock (/clock). It broadcasts the position (lio_odom), path traveled, scan in two frames, and a TF edge. /rosout, /parameter_events and 6 service parameters are present in every node, ignored when reading.

NodeSubscribes toPublishesService / action
/pgo/pgo_node/fastlio2/body_cloud, /fastlio2/lio_odom/atlas3d_map, /pgo/optimized_path, /pgo/loop_markers, /tf/pgo/save_maps (M01 lesson 2)
/planner_server(costmap inside)/planaction /compute_path_to_pose
/bt_navigator——action /navigate_to_pose: "2D Goal Pose" by RViz sent here

ros2 topic info

ros2 topic info /velodyne_points
Type: sensor_msgs/msg/PointCloud2
Publisher count: 1
Subscription count: 1

Add -v to see the name of each transmit/receive node. In navigation mode /velodyne_points there are 2 receiving nodes: lio_node and obstacle_filter.

Publisher count is not the number of broadcasting nodes

In scan and navigation mode, ros2 topic info /tf -v reports 4 publishers: robot_state_publisher, lio_node, pgo_node or localizer_node, and diff_drive_controller. If /tf actually sounds like diff_drive_controller doesn't send any messages: wheel_odom_tf:=false just turns off sending, the controller still creates the publisher.

Publisher count counts the number of publishers created, including publishers that never sent. If you want to know who actually publishes which TF side, use the tool from lesson 2.

Frequency

ros2 topic hz same as M00 lesson 4. Important topics on the dev machine:

TopicSourceFrequency
/velodyne_pointsros_gz_bridge~10 Hz
/imu/dataimu_filter_node~200 Hz
/fastlio2/lio_odomlio_node~10 Hz, one scan at a time
/atlas3d_mappgo_nodeevery 2 s

If there is an interface, rqt_graph draws a node–topic diagram similar to the scene in lesson 0 (package ros-humble-rqt-graph).

Nodes and topics: how programs exchange data · Module 2: The big picture — Atlas Robotics