Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong point cloud origin when accumulating data of different sensors #947

Open
fabln opened this issue Mar 1, 2018 · 12 comments · Fixed by iron-ox/cartographer#2 · May be fixed by #1850
Open

Wrong point cloud origin when accumulating data of different sensors #947

fabln opened this issue Mar 1, 2018 · 12 comments · Fixed by iron-ox/cartographer#2 · May be fixed by #1850
Assignees
Labels

Comments

@fabln
Copy link

fabln commented Mar 1, 2018

Hi,
I'm going to map with four LIDARs which have some position separation. The occupancy grid (see screenshot) then gets some free-space lines drawn between e.g. sensor 1 (the upper right) and the orange data points measured by sensor 4 (the sensor most left). I think this shouldn't be the case, i.e. only free-space lines between each sensor and its own measured point cloud.

This is observed with setting TRAJECTORY_BUILDER_2D.num_accumulated_range_data >=1. With TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1, the behavior is correct, however scan matching quality is lowered then. I tested only the 2D version.
multi-lidar-map

@gaschler
Copy link
Contributor

gaschler commented Mar 1, 2018

I believe your urdf config is incorrect.
After you fixed the urdf config, you should accumulate as many range data sets as you have sensors (or even multiple thereof if the packets to do contain a full scanner revolution.)

@fabln
Copy link
Author

fabln commented Mar 1, 2018

Well, the sensor positions are fairly OK as set in the urdf (I did not yet calibrate the sensor positions. It seems that point clouds of multiple measurements are accumulated together and then joined with the map assuming that all data are originating from the same origin which is not the case.

@gaschler
Copy link
Contributor

gaschler commented Mar 1, 2018

No, cartographer_ros queries tf and transforms the data to the tracking frame.

For more help, please give more details on your config following the issue template https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/.github/ISSUE_TEMPLATE

@fabln
Copy link
Author

fabln commented Mar 1, 2018

I cloned the master branch on 2018-02-28 and executed with the default values of your backpack 2D demo. Running the cartographer_rosbag_validate returned only timing issues not important so far.

With the 4 LIDARs (in this case, onboard a car just standing in the garage), I would expect a map like this (couldn't tune to get this, so I photoshopped):
multi-lidar-map-expect

@gaschler
Copy link
Contributor

gaschler commented Mar 2, 2018

Cartographer makes the occupancy grid insertions by rays from the return point to the single tracking frame origin.
(In 3D, the insertion ray starts at the return point and is very short.)
So, what you are describing I would call a feature request to insert rays to their respective sensor positions.
Sounds interesting for vehicles with multiple sensors at either side that go through smaller passages.

@fabln
Copy link
Author

fabln commented Mar 2, 2018

Yes, that's what I mean.

@cschuet
Copy link

cschuet commented Mar 10, 2018

If it is true that Cartographer makes the occupancy grid insertions by rays from the return point to the single tracking frame origin rather than to their respective ray origins, should we not classify this as a bug?

@gaschler gaschler added bug and removed enhancement labels Mar 12, 2018
@gaschler
Copy link
Contributor

Just some context, the LocalTrajectoryBuilder::AddAccumulatedRangeData and the RangeDataInserters accept only one origin. (So this is not a regression, but rather a well-justified feature request.)

@maxschnettler
Copy link

Is this issue as well as #1242 already fixed with the referenced merge #1357 ? We are experiencing the same problem of the wrong origin of laser rays with version 1.0.0 and think about upgrading Cartographer to a newer version

@wkwkw
Copy link

wkwkw commented Aug 9, 2019

I think the answer is no. We are also experiencing the same problem as #1242 and just tested the latest cartographer/cartographer_ros yesterday to find the problem being still alive.

@FabianSchurig
Copy link

FabianSchurig commented Aug 9, 2019

I also tested the current master version of Cartographer. The problem still persists. It seems not solved yet.

I am convinced, that this is a critical bug. It can be easily tested if you use range sensors mounted somewhat far from the tracking_frame, which have no overlapping field of view to this frame.

The following image is a good example. The laser is mounted in front of the robot's coordinate frame (base). The highlighted triangle is a dead spot. Cartographer says the area is free, although we don't know if that is true.
raycasting_origin_bug

This bug is not only related to accumulating multiple sensors, but can be also reconstructed with one single laser scanner.

@jonbinney
Copy link

jonbinney commented Jul 8, 2020

This does seem to be a very severe bug - any robot which has either of

  • multiple lasers
  • a laser that is not located at the origin of the child frame used for odometry data

will have freespace calculated incorrectly by cartographer. I think this might take a fair bit of work to fix, however, because you can no longer take the approach of "convert all data to the tracking frame and then deal with it". Instead, each scan will need to keep some information about its origin.

@MichaelGrupp MichaelGrupp self-assigned this Apr 20, 2021
ValerioMagnago added a commit to magazino/cartographer that referenced this issue Aug 13, 2021
Adds the laser ray origin to `RangefinderPoint` to enable
correct raytracing of range data misses into a 2D probability
grid also after scan accumulation.

Previously, all rays were casted from their hit point to the
tracking frame. This is wrong for any setup where the tracking
frame is not the sensor frame and leads to artifacts in the map.

Fixes: cartographer-project#947
@ValerioMagnago ValerioMagnago linked a pull request Aug 13, 2021 that will close this issue
ValerioMagnago added a commit to magazino/cartographer that referenced this issue Aug 13, 2021
Adds the laser ray origin to `RangefinderPoint` to enable
correct raytracing of range data misses into a 2D probability
grid also after scan accumulation.

Previously, all rays were casted from their hit point to the
tracking frame. This is wrong for any setup where the tracking
frame is not the sensor frame and leads to artifacts in the map.

Fixes: cartographer-project#947
Signed-off-by: Valerio Magnago <magnago@magazino.eu>
WanghaoRockrobo pushed a commit to RockRobo/cartographer that referenced this issue Mar 14, 2022
Adds the laser ray origin to `RangefinderPoint` to enable
correct raytracing of range data misses into a 2D probability
grid also after scan accumulation.

Previously, all rays were casted from their hit point to the
tracking frame. This is wrong for any setup where the tracking
frame is not the sensor frame and leads to artifacts in the map.

Fixes: cartographer-project#947
Signed-off-by: Valerio Magnago <magnago@magazino.eu>
ValerioMagnago added a commit to magazino/cartographer that referenced this issue Apr 3, 2022
Adds the laser ray origin to `RangefinderPoint` to enable
correct raytracing of range data misses into a 2D probability
grid also after scan accumulation.

Previously, all rays were casted from their hit point to the
tracking frame. This is wrong for any setup where the tracking
frame is not the sensor frame and leads to artifacts in the map.

Fixes: cartographer-project#947
Signed-off-by: Valerio Magnago <magnago@magazino.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants