Skip to content

Fix NDT initial pose mechanism

Nikolai Morin requested to merge 636-fix-ndt-initialpose into integration

Description

NDT initialization from RViz was broken. The pose from the /initialpose message was published directly into /tf, but if this message comes from RViz and we're running in simulation, RViz and data coming from LGSVL (the observations) will sometimes have very large differences in their timestamps (e.g. RViz being 40s newer). The pose would be seen as being way in the future and the localizer couldn't use it as its next initial pose.

Notes for Reviewer

Alternatives considered:

  • Store the pose in RelativeLocalizerNode, check for existence of a new pose on each observation_callback, if yes, adjust the header timestamp and publish that (or call setTransform())
  • Simply make the pose_initializer not complain about future poses

I am also not 100% positive the problem in the description is one we have to work around – maybe RViz can somehow use LGSVL time domain?

However, this allowed me to also remove a bunch of complexity related to the first-init hack.

Checklist

  • Documentation was updated
Edited by Nikolai Morin

Merge request reports