TixiaoShan/LIO-SAM

Rooftop rosbag not working in ROS2

Opened this issue · 2 comments

Hi, I am in ROS2 humble, ubuntu 22.04
I have downloaded the rooftop_ouster_dataset.bag from here. Then I used rosbags to convert ROS1 bag to ROS2 bag. My params file is as follows (only the ones I changed)

/**:
  ros__parameters:

    # Topics
    pointCloudTopic: "/points_raw"                   # Point cloud data
    imuTopic: "/imu_raw"                        # IMU data
    odomTopic: "odometry/imu"                    # IMU pre-preintegration odometry, same frequency as IMU
    gpsTopic: "odometry/gpsz"                    # GPS odometry topic from navsat, see module_navsat.launch file

    # Frames
    lidarFrame: "os_lidar"
    baselinkFrame: "base_link"
    odometryFrame: "odom"
    mapFrame: "map"

    # GPS Settings
    useImuHeadingInitialization: false           # if using GPS data, set to "true"
    useGpsElevation: false                       # if GPS elevation is bad, set to "false"
    gpsCovThreshold: 2.0                         # m^2, threshold for using GPS data
    poseCovThreshold: 25.0                       # m^2, threshold for using GPS data

    # Export settings
    savePCD: false                               # https://github.com/TixiaoShan/LIO-SAM/issues/3
    savePCDDirectory: "/Downloads/LOAM/"         # in your home folder, starts and ends with "/". Warning: the code deletes "LOAM" folder then recreates it. See "mapOptimization" for implementation

    # Sensor Settings
    sensor: ouster                               # lidar sensor type, either 'velodyne', 'ouster' or 'livox'
    N_SCAN: 32                                   # number of lidar channels (i.e., Velodyne/Ouster: 16, 32, 64, 128, Livox Horizon: 6)
    Horizon_SCAN: 512                            # lidar horizontal resolution (Velodyne:1800, Ouster:512,1024,2048, Livox Horizon: 4000)
    downsampleRate: 1                            # default: 1. Downsample your data if too many
    # points. i.e., 16 = 64 / 4, 16 = 16 / 1
    lidarMinRange: 1.0                           # default: 1.0, minimum lidar range to be used
    lidarMaxRange: 1000.0 

I have used a static transform publisher to link lidar_link to os_lidar as this is the frame id of the /points_raw.

  • ros2 bag play my_bagfile
  • ros2 launch lio_sam run.launch.py

My tf tree
image

There's nothing shown in Rviz
image

ros2 topic echo /imu_raw --once
header:
  stamp:
    sec: 1594151157
    nanosec: 468152549
  frame_id: imu_link
orientation:
  x: 0.11496150493621826
  y: -0.151968315243721
  z: -0.712364673614502
  w: 0.6754450798034668
orientation_covariance:
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
angular_velocity:
  x: -0.29357796907424927
  y: 0.021105529740452766
  z: 0.48917731642723083
angular_velocity_covariance:
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
linear_acceleration:
  x: 2.368850171416998
  y: 0.7340992871671915
  z: -8.511016484498978
linear_acceleration_covariance:
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
- 0.0
- 0.0
- 0.0
- 0.01
 ros2 topic echo /points_raw --once
header:
  stamp:
    sec: 1594151229
    nanosec: 817840896
  frame_id: os_lidar
height: 128
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: 2
  count: 1
- name: noise
  offset: 28
  datatype: 4
  count: 1
- name: range
  offset: 32
  datatype: 6
  count: 1
is_bigendian: false
point_step: 48
row_step: 49152
data:
- 203
- 29
- 129
- 188
- 11
- 78
- 155
- 186
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 192
- 64
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 140
- 3
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 212
- 17
- 183
- 106
- 209
- 127
- 0
- 0
- 227
- 111
- 129
- 188
- 151
- 91
- 215
- 185
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 192
- 64
- 0
- 0
- 0
- 0
- 0
- 0
- 1
- 0
- 96
- 3
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 212
- 17
- 183
- 106
- 209
- 127
- 0
- 0
- 8
- 114
- 129
- 188
- 231
- 233
- 193
- 57
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 160
- 64
- 0
- 0
- 0
- 0
- 0
- 0
- 2
- 0
- 10
- 3
- 0
- 0
- '...'
is_dense: true
---

Any pointers to where am I going wrong? Thanks in advance

the problem is your tf tree. In Rviz, for seen the map, it show the tf "map". But here your frame map isn't active/powered. for the active this map, you must to create a tf transform dynamic with the tf odom and the tf base_link (tf of your robot). Like that, your tf map will be active. Because actually, the point of your robot isn't send at your tf map, so the map don't create cause she not receives points.

@Spirquel : Thanks for the reply. However I am still a bit confused here. The odom --> base_link transform is to be published by the SLAM system, isn't? What I observed after running the LIO_SAM is that it is not being published for reasons unknown to me yet.
The map-->odom is a static transform published by the run.launch.py and hence it's available as a detached one in the TF tree