AutonomyLab/ardrone_autonomy — pull request #41 by mikehamer (2012-11-27 13:02:42+00:00)
Title: Fixed bug with navdata handling & improved initialization

This bug was introduced when changing the new-style navdata message variable from local, to class scope. This meant it wasn't recreated on every send loop.

This is not a problem for non-array message members, which were overwritten with the new value before being sent. However array-typed members of the message (for example detections in navdata_vision_detect), were not cleared between loops, and the data would simply accumulate through .push_back(...).

Now I clear the array types before pushing the new data into them.

I have also changed the initialization, such that it occurs in configureDrone(), rather than occurring the first time a message is sent.