Issue with cartographer and Ouster lidar

asked 2021-05-20 06:13:23 -0500

liambroek gravatar image

I'm use ROS noetic. I've installed google cartographer and followed this tutorial to use it with a provided bag file and it works fine. I am now trying to run it with a bag file I have been provided with from ouster for the os1-128. This bag file provides one point cloud as well as imu data. I have remapped these topics in the ouster launch file so that that now publish to /points2 and /imu. I have also changed the num_point_clouds=1 in the lua file.

The issue I am having is that the map that is being built is not correct. It seems like the entire 3d point cloud is being flattened onto the 2d map, which of course is not what you want. I am using the backpack_3d_launch file.

Below is an extract from the .lua file where I have made changes:

options = { map_builder = MAP_BUILDER, trajectory_builder = TRAJECTORY_BUILDER, map_frame = "map", tracking_frame = "base_link", published_frame = "base_link", odom_frame = "odom", provide_odom_frame = true, publish_frame_projected_to_2d = false, use_pose_extrapolator = true, use_odometry = false, use_nav_sat = false, use_landmarks = false, num_laser_scans = 0, num_multi_echo_laser_scans = 0, num_subdivisions_per_laser_scan = 1, num_point_clouds = 1, lookup_transform_timeout_sec = 0.2, submap_publish_period_sec = 0.3, pose_publish_period_sec = 5e-3, trajectory_publish_period_sec = 30e-3, rangefinder_sampling_ratio = 1., odometry_sampling_ratio = 1., fixed_frame_pose_sampling_ratio = 1., imu_sampling_ratio = 1., landmarks_sampling_ratio = 1., }

I edited the os_cloud_node.cpp file as for some reason editing my urdf file still left me with issues with my transforms.

using PacketMsg = ouster_ros::PacketMsg; using Cloud = ouster_ros::Cloud; using Point = ouster_ros::Point; namespace sensor = ouster::sensor;

int main(int argc, char** argv) { ros::init(argc, argv, "os_cloud_node"); ros::NodeHandle nh("~");

auto tf_prefix = nh.param("tf_prefix", std::string{});
if (!tf_prefix.empty() && tf_prefix.back() != '/') tf_prefix.append("/");
auto sensor_frame = tf_prefix + "horizontal_vlp16_link";                             **********edit
auto imu_frame = tf_prefix + "imu_link";                                           **********edit
auto lidar_frame = tf_prefix + "os_lidar";

Screenshot of the map that gets created:

C:\fakepath\Screenshot from 2021-05-20 11-59-45.png

Screenshot of a part of the point cloud I recieve:

C:\fakepath\Screenshot from 2021-05-20 12-05-10.png

Any help will be greatly appreciated, thanks!

edit retag flag offensive close merge delete