ros2 / geometry2

A set of ROS packages for keeping track of coordinate transforms.
BSD 3-Clause "New" or "Revised" License
110 stars 193 forks source link

[cache_unittest] Add direct implementation testing on ordering, pruning (backport #678) #689

Closed mergify[bot] closed 1 month ago

mergify[bot] commented 1 month ago

Towards #676 This changes nothing pertaining to the implementation. It only adds testing. Some of it is implementation-specific, but towards the ends of performance checks.

From https://github.com/ros2/geometry2/issues/676#issuecomment-2102512107

  1. It needs to hold an arbitrary number of entries, because we don't know the rate at which we will get data.
  2. The items needs to be in sorted order by timestamp, from the newest entry to the oldest.
  3. New items need to be inserted into arbitrary positions, as timestamps may come in out-of-order.
  4. Duplicates shouldn't be allowed.
  5. Old items need to be pruned out.

To answer them:

  1. There appears to be no limit on size. Not sure how to test this in a bounded fashion.
  2. This was not tested. Now explicitly tested via ImplSortedDescendingUniqueEntries
  3. This was not tested. Now explicitly tested via ImplSortedDescendingUniqueEntries
  4. This was already tested, but is also explicitly tested via ImplSortedDescendingUniqueEntries
  5. This was not tested (I believe). Now explicitly tested via ImplSortedDescendingUniqueEntries
    This is an automatic backport of pull request #678 done by Mergify.
mergify[bot] commented 1 month ago

Cherry-pick of a17a2bf8297052d2c6a404f9799bfe3b81040482 has failed:

On branch mergify/bp/iron/pr-678
Your branch is up to date with 'origin/iron'.

You are currently cherry-picking commit a17a2bf8.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
    modified:   tf2/src/cache.cpp
    modified:   tf2/test/cache_unittest.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
    both modified:   tf2/include/tf2/time_cache.h

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

ahcorde commented 1 month ago