Skip to content

Causes of vastly different ICP runtimes #596

@kam3k

Description

@kam3k

What would cause the ICP runtime to vary significantly, despite very similar inputs?

More specifically, I am running scan matching on a sequence of scans from the same 2D lidar. There is < 20 cm of displacement and < 2 deg of rotation between the two point clouds, and I provide ICP with an initial guess from odometry. In other words, the reading and reference clouds begin nearly aligned, and ICP is just making a small adjustment.

My data points filters (applied to both reading and reference) are:

  1. SimpleSensorNoiseDataPointsFilter
  2. ObservationDirectionDataPointsFilter
  3. SurfaceNormalDataPointsFilter
  4. OrientNormalsDataPointsFilter

The matcher is KDTreeMatcher, the outlier filters are TrimmedDistOutlierFilter and SurfaceNormalOutlierFilter, the error minimizer is PointToPlaneWithCovErrorMinimizer, the transformation checkers are DifferentialTransformationChecker and CounterTransformationChecker, and a RigidTransformation transformation is specified.

Both the reading and reference clouds have about ~1000 pts each (this could possibly be downsampled if needed).

When I run ICP using this set up, the alignment time varies significantly, fluctuating between ~8 ms to ~300 ms. My lidar data is coming in at 25 Hz, which means this could run online if ICP took < 40 ms (which is does sometimes).

I was wondering, what is likely the cause of these big fluctuations in runtime?

I took a look a the logs, and the pre-processing times can vary, but not as much as ICP itself (sometimes it is ~50x slower than other times).

As an aside, the log reports pre-processing times of the clouds, and of ICP, but the times don't make sense. For example, it will say:

PointMatcher::icp - reference pre-processing took 0.112477 [s]
PointMatcher::icp - reading pre-processing took 0.133762 [s]
PointMatcher::icp - 4 iterations took 0.905763 [s]

which if you sum up, adds up to more than one second. But measuring how long the call to the ICP function took (with std::steady_clock) is much less, in this case it was 120 ms.

At the end of the day my goal is to have ICP run quickly (< 40 ms) but perhaps more importantly, consistently. Are there data filters and/or parts of the pipeline that can be configured, added, or removed to help achieve a more consistent, fast runtime?

Any help would be greatly appreciated. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions