ros-perception / laser_filters

Assorted filters designed to operate on 2D planar laser scanners, which use the sensor_msgs/LaserScan type.
BSD 3-Clause "New" or "Revised" License
161 stars 199 forks source link

Add speckle filter unit tests #129

Closed erwinbonsmatopic closed 2 years ago

erwinbonsmatopic commented 2 years ago

Added google-test based unit tests for the speckle filter.

This prepares for refactoring the implementation to speed up performance.

The test include a very basic performance set-up, which executes the update method 10000 times. This can be used to compare the performance before/after refactoring. It is disabled by default. It can be enabled by passing the CATKIN_ENABLE_PERFORMANCE_TESTING to cmake.

Added configure method to LaserScanSpeckleFilter to enable unit testing filter without relying on ROS configuration infrastructure.

The new tests are executed when running ci.sh, they all pass and run in 0.09 seconds (on my machine)

JaccovdS commented 2 years ago

@jonbinney ping

jonbinney commented 2 years ago

This change looks good, thanks @JaccovdS ! I'm going to merge it into indigo-devel (from which melodic gets released) and the new noeticv-devel branch (from which noetic will be released from now on)

jonbinney commented 2 years ago

Actually, retargeting this to indigo-devel got ugly; I'm going to merge this into just noetic-devel for now. If you want it in melodic, go ahead and open a separate PR to the indigo-devel branch.

JaccovdS commented 2 years ago

This change looks good, thanks @JaccovdS ! I'm going to merge it into indigo-devel (from which melodic gets released) and the new noeticv-devel branch (from which noetic will be released from now on)

All credits to @erwinbonsmatopic I only did the ping ;)