Design a localization system for a mobile robot that should mark lidar endpoints arising from dynamic objects and report them to the interface. Sketch a potential header implementation with comments explaining what the methods should do. Detail the development order.
Answer:
Development order
write the topic stub and the service stub and test in simulation that all topics go through. As debug dump an image of the DMap (or send it to RViz).
run the system without enabling the localization, from an initial pose and show the robot in the map. Display the robot position by integrating an odom message. The robot should move consistently with the joystick messages.
manually place the robot at a known and consistent position on a map free from dynamics. Zero the odometry errors. Monitor the distances at the reprojected lidar endpoints. They should be low. Test the state transition (lost->tracking). It should transition after few frames.
wire the dmap update. Test the convergence by adding a perturbation to the current position. It should come back to a reasonable fit.
load the simulator with a map made by adding objects to the localizer's one. These objects should be labeled as dynamic.
test if the robot gets lost by teleporting it in the simulator