ros-planning/navigation — pull request #53 by DLu (2013-05-18 00:45:22+00:00)
Title: Working Unit Tests

A bunch of work I did to get the existing costmap_2d tests to work with the new framework.

Includes:
* Some minor work to get tests outside of costmap to compile/run (amcl/voxel_grid)
* Splitting module_tests.cpp into three files for the static, inflation and obstacle layers
* Note: Static tests were less relevant so I did not port them (yet?)
* Note2: module_tests.cpp is still around, but not compiled
* Additional functionality for easy testing (mostly adding a way to add obstacles without subscriptions)
* A static map in two files (test/TenByTen.*) that mirror the static map used in module_tests

Errors fixed while testing:
* Integer bounds for inflation are non-inclusive, so fixed one boundary error [1]
* Include the origin of observations for bounds checking [2]

Tests that remain broken:
* In inflation tests, one part of testInflation3 fails because it counts FREE_SPACE cells. However, the number the old test was expecting incudes all cells that have updated values. Since some of the updated values are 0, they are counted as free space, and thus the test reports more free space than it should. It's unclear whether this worked in the original tests.

[1] https://github.com/DLu/navigation/blob/b9858f93c71bb3577b13d3d7f0524506f70c390e/costmap_2d/plugins/inflation_layer.cpp#L110
[2] https://github.com/DLu/navigation/blob/b9858f93c71bb3577b13d3d7f0524506f70c390e/costmap_2d/plugins/obstacle_layer.cpp#L400
[3] https://github.com/DLu/navigation/blob/b9858f93c71bb3577b13d3d7f0524506f70c390e/costmap_2d/test/inflation_tests.cpp#L306