autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
963 stars 627 forks source link

Positioning error in wrong zone when NDT starts #1421

Closed meliketanrikulu closed 1 year ago

meliketanrikulu commented 2 years ago

Checklist

Description

We encountered a random error while NDT was running. After the initial pose estimation stages (monte carlo lozalization) were performed correctly, we observed that when starting NDT, its position was set somewhere between the origin point of the map and the correct location of the vehicle, or it was set directly to the origin point of the map. While receiving these errors, we see that our gnss errors are not high.

Expected behavior

We expect NDT to search in the right area stably.

Actual behavior

We observed that when starting NDT, its position was set somewhere between the origin point of the map and the correct location of the vehicle, or it was set directly to the origin point of the map. video 1 video 2 error_ndt2

Steps to reproduce

bags maps We are working with UTM. You have to select lanelet2_map_projector_type parameter to UTM in tier4_map_loader packages launch file and you could set coordinate_system parameter as 4: LocalCartesianUTM in gnss_poser package

Versions

No response

Possible causes

Before starting NDT, particle filter is used when estimating initial pose, and we visualized best_particle in rviz to make sure there is no problem at this stage. We have seen that this stage works correctly and that the vehicle is in its position. After making sure that this stage works correctly, the NDT algorithm is constantly subscribing to a pose published from ekf, and an algorithm is running to use the most appropriate pose from the poses from ekf. When ekf node starts, it generates a pose at 0 0 0 at the central point of the map.When the NDT algorithm started, we think that there may have been a problem in the algorithm trying to choose the right one among the pose values it received from ekf. For this reason, it tries to produce poses by referencing old poses (map center) from ekf or one of the values in between.

Additional context

No response

YamatoAndo commented 2 years ago

Thank you for your report. You are right, it seems to refer to the NDT node for a pose at 0 0 0.

To fix this problem, I think that the EKF node should not publish the pose until it receives the initialization pose. I think that way, the NDT node would not receive a pose at 0 0 0.

meliketanrikulu commented 2 years ago

NDT node graph: Screenshot from 2022-07-26 18-23-29

YamatoAndo commented 2 years ago

@meliketanrikulu I would like to put a flag in ekf_localizer not to estimate the position until the initial position is received. Any opinions on that?

※ Note that this is a temporary fix and the same problem may occur when re-initializing.

meliketanrikulu commented 2 years ago

@meliketanrikulu I would like to put a flag in ekf_localizer not to estimate the position until the initial position is received. Any opinions on that?

※ Note that this is a temporary fix and the same problem may occur when re-initializing.

Hello @YamatoAndo . We solved this problem temporarily by publishing the initial pose for a second.Maybe it is not necessary to keep this period for so long. Both of these methods seem to offer temporary fix. We can talk about this again according to the method to be used for reinitialization. If a method such as slowing down or stopping the vehicle is used, we can send the initial pose for a while.

YamatoAndo commented 2 years ago

@meliketanrikulu

We can talk about this again according to the method to be used for reinitialization.

Sure!

meliketanrikulu commented 2 years ago

@meliketanrikulu I would like to put a flag in ekf_localizer not to estimate the position until the initial position is received. Any opinions on that?

※ Note that this is a temporary fix and the same problem may occur when re-initializing.

Is there related PR @YamatoAndo

xmfcx commented 2 years ago

Fixes:

mitsudome-r commented 2 years ago

I think new API for initialization is being discussed in this PR https://github.com/autowarefoundation/autoware.universe/pull/1431.

IshitaTakeshi commented 2 years ago

By the way now I'm refactoring the EKF code and trying to find and resolve these problems but it takes a while

IshitaTakeshi commented 2 years ago

I think that the easiest way to resolve the problem of publishing the identity pose is

  1. Create a flag that manages the initialization state
  2. Make the flag true when receiving the initial pose
  3. Update the pose using the messages from NDT and publish the estimated pose only if the flag is true
IshitaTakeshi commented 2 years ago

I opened a draft PR to realize the above

mitsudome-r commented 2 years ago

@meliketanrikulu Could you confirm that the issue is fixed with the PR ?