I'm working on SLAM using Nav2 and Slam_Toolbox and am attempting to create a 2D Occupancy Map.
My setup is as follows:
- Jetson Orin AGX
- ROS2 Humble
- Ouster OS1-32 Lidar
pointcloud_to_laserscanto convert my Lidar's 3D point cloud into a 2D laser scan- I have an odometry node that's publishing successfully
The Problem
pointcloud_to_laserscannode is running, but not outputting anything. There are no/scanmessages out.base_linkdoes not exist in the TF tree at runtime
What I've Tried So Far
- When running
ros2 node list, this is the output:
/odom_publisher_node /pointcloud_to_laserscan /rviz /slam_toolbox /static_tf_caster_link /static_tf_left_wheel_link /static_tf_oak_d_base_frame /static_tf_oak_d_frame /static_tf_oak_rgb_camera_optical_frame /static_tf_os_sensor /static_tf_right_wheel_link /static_transform_publisher_MCnqig9ibJzSxa08 /transform_listener_impl_aaaac1509120 /transform_listener_impl_aaaaef6a6310 /transform_listener_impl_aaaaf0fa7a30 - Ouster is successfully publishing to PointCloud2. When I run
ros2 topic list | grep ouster, this is the output:
/ouster/imu /ouster/metadata /ouster/nearir_image /ouster/os_driver/transition_event /ouster/points /ouster/range_image /ouster/reflec_image /ouster/scan /ouster/signal_image /ouster/telemetry - This is what I get when I run
ros2 topic echo /ouster/scan --once:
header: stamp: sec: 2054 nanosec: 573807580 frame_id: os_lidar angle_min: -3.1415927410125732 angle_max: 3.1415927410125732 angle_increment: 0.006135923322290182 time_increment: 9.765625145519152e-05 scan_time: 0.10000000149011612 range_min: 0.10000000149011612 range_max: 120.0 ranges: - 2.2880001068115234 - 2.2829999923706055 - 2.2780001163482666 - 2.2739999294281006 - 2.2720000743865967 - 2.2709999084472656 - 2.2709999084472656 - 2.2679998874664307 - 2.2709999084472656 - 2.2699999809265137 - 2.2690000534057617 - 2.2679998874664307 - 2.2690000534057617 intensities: - 86.0 - 77.0 - 76.0 - 83.0 - 69.0 - 82.0 - 66.0 - 72.0 - 67.0 - 60.0 - 73.0 - 61.0 - 66.0 - 63.0 - 69.0 - 99.0 - 73.0 - 76.0 - 64.0 - 69.0 - 78.0 - This is what I get when I run
ros2 topic echo /ouster/points --once
header: stamp: sec: 2072 nanosec: 671144310 frame_id: os_lidar height: 32 width: 1024 fields: - name: x offset: 0 datatype: 7 count: 1 - name: y offset: 4 datatype: 7 count: 1 - name: z offset: 8 datatype: 7 count: 1 - name: intensity offset: 16 datatype: 7 count: 1 - name: t offset: 20 datatype: 6 count: 1 - name: reflectivity offset: 24 datatype: 4 count: 1 - name: ring offset: 26 datatype: 4 count: 1 - name: ambient offset: 28 datatype: 4 count: 1 - name: range offset: 32 datatype: 6 count: 1 is_bigendian: false point_step: 48 row_step: 49152 data: - 233 - 205 - 162 - 63 - 190 - 72 - 196 - 61 - 13 - 45 - 250 - 62 - 0 - 0 - 128 - 63 - 0 - 0 - 14 - 67 - 0 - 0 - 0 - 0 - 152 - 1 I get no output, however, when I run
ros2 topic echo /scan --onceWhen I run
ros2 run tf2_ros tf2_echo base_link os_lidar, this is the output I get:
[INFO] [1750875803.938223113] [tf2_echo]: Waiting for transform base_link -> os_lidar: Invalid frame ID "base_link" passed to canTransform argument target_frame - frame does not exist At time 0.0 - Translation: [0.000, 0.000, 0.000] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] - Rotation: in RPY (radian) [0.000, -0.000, 0.000] - Rotation: in RPY (degree) [0.000, -0.000, 0.000] - Matrix: 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 At time 0.0 - Translation: [0.000, 0.000, 0.000] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] - Rotation: in RPY (radian) [0.000, -0.000, 0.000] - Rotation: in RPY (degree) [0.000, -0.000, 0.000] - Matrix: 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 At time 0.0 - Translation: [0.000, 0.000, 0.000] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] - Rotation: in RPY (radian) [0.000, -0.000, 0.000] - Rotation: in RPY (degree) [0.000, -0.000, 0.000] - Matrix: 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 At time 0.0 - Translation: [0.000, 0.000, 0.000] - Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000] - Rotation: in RPY (radian) [0.000, -0.000, 0.000] - Rotation: in RPY (degree) [0.000, -0.000, 0.000] - Matrix: 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 My Code
- Here's my static transforms file:
from launch import LaunchDescription from launch_ros.actions import Node def static_tf(x, y, z, roll, pitch, yaw, frame_id, child_frame_id): return Node( package="tf2_ros", executable="static_transform_publisher", name=f"static_tf_{child_frame_id.replace('/', '_')}", arguments=[str(x), str(y), str(z), str(roll), str(pitch), str(yaw), frame_id, child_frame_id], output="screen" ) def generate_launch_description(): return LaunchDescription([ static_tf(0, 0.287655, 0, 0, 0, 0, "base_link", "left_wheel_link"), static_tf(0, -0.287655, 0, 0, 0, 0, "base_link", "right_wheel_link"), static_tf(0.41275, 0, 0, 0, 0, 0, "base_link", "caster_link"), static_tf(0.47625, 0, 0.24655, 0, 0, 0, "base_link", "oak_d_base_frame"), static_tf(0.02, 0, 0, 0, 0, 0, "oak_d_base_frame", "oak_d_frame"), static_tf(0, 0, 0, -1.5708, 0, -1.5708, "oak_d_frame", "oak_rgb_camera_optical_frame"), static_tf(0.2286, 0.0, 0.3912, 0, 0, 0, "base_link", "os_sensor"), ]) - I'm also running:
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link os_lidar - And:
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_link - This is my
pointcloud_to_laserscannode script:
ros2 run pointcloud_to_laserscan pointcloud_to_laserscan_node --ros-args -r input:=/ouster/points -r scan:=/scan -p target_frame:=base_link -p transform_tolerance:=0.01 -p min_height:=-1.0 -p max_height:=1.0 -p angle_min:=-3.14 -p angle_max:=3.14 -p angle_increment:=0.003 -p range_min:=0.3 -p range_max:=10.0 -p scan_time:=0.1 -p use_header_stamp:=true If anyone has any suggestions, it'd be much appreciated!