Google cartographer Laser from wrong origin

asked 2021-02-10 04:13:22 -0500

jakobvinkas gravatar image

Hello!

I'm trying to use Google Cartographer with a LiDAR and a robot with wheel odometry data. As the laser messages are being processed, the points that they "hit" are derived correctly with the "laser_link" as origin however the "rays" of free area is then derived using the "base_link" which is offcource wrong since that gives the wrong perspective.

To clearly illustrate the problem, here is a case where the laser is inside a building and the joint to the "base_link" is set far away such that it is outside of the building. All of the rays are clearly derived from the "base_link" even though the 2D points that are found by the LiDAR are all correct.

(I could not post an image but here is a link)

https://imgur.com/a/HiDsFMg

As can bee seen the robot is moving a bit but it is still clear that the "rays of unoccupied space" has its origin in the base_link when is should originate from the LiDAR. Not again that all the points are in the correct area even though they are given as distance/angle which means that they are in fact derived from the "laser_link".

My URDF and LUA files are as follows:

<robot name="AGV">

  <link name="base_link">
  </link>

  <link name="pf_lidar_link">
  </link>

  <joint name="pf_lidar_link_joint" type="fixed">
    <parent link="base_link" />
    <child link="pf_lidar_link" />
    <origin xyz="20 0 0" />
  </joint>

</robot>

Lua:

include "map_builder.lua"
include "trajectory_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "base_link", 
  published_frame = "base_link",
  odom_frame = "odom_link",
  provide_odom_frame = false,
  publish_frame_projected_to_2d = true,
  use_pose_extrapolator = true,
  use_odometry = false,
  use_nav_sat = false,
  use_landmarks = false,
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  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.,
}

MAP_BUILDER.use_trajectory_builder_2d = true
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 11


return options
edit retag flag offensive close merge delete