Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug with navdata handling & improved initialization #41

Merged
merged 3 commits into from
Nov 27, 2012
Merged

Fixed bug with navdata handling & improved initialization #41

merged 3 commits into from
Nov 27, 2012

Conversation

mikehamer
Copy link
Contributor

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.

…ld grow in size.

This bug was introduced when moving local scope message variables to class-level. This move meant that messages wouldn't be reset after being sent. This was not a problem for non-array type message members, which were reassigned before being sent. However for array-type message members, which are filled using .push_back, no reset occurred. This fix appropriately clears these members before re-filling them on every send-loop.
@mikehamer
Copy link
Contributor Author

I've now added the TODO print of navdata_demo state. Also, I tested the navdata_demo bug that @JakobEngel mentioned, and couldn't reproduce it:

[ INFO] [1354021877.508817431]: Navdata Publish Settings:
[ INFO] [1354021877.508839283]:     Legacy Mode: On
[ INFO] [1354021877.508863820]:     ROS Loop Rate: 50
[ INFO] [1354021877.508885633]:     Instant New Navdata Publish: On
[ INFO] [1354021877.508901832]:     Drone Send Speed: 200Hz (navdata_demo=0)
# rostopic hz /ardrone/navdata_gyros_offsets
subscribed to [/ardrone/navdata_gyros_offsets]
average rate: 196.113
    min: 0.000s max: 0.031s std dev: 0.00430s window: 195
[ INFO] [1354021928.585211517]: Navdata Publish Settings:
[ INFO] [1354021928.585280838]:     Legacy Mode: On
[ INFO] [1354021928.585344546]:     ROS Loop Rate: 50
[ INFO] [1354021928.585415812]:     Instant New Navdata Publish: On
[ INFO] [1354021928.585488047]:     Drone Send Speed: 15Hz (navdata_demo=1)
# rostopic hz /ardrone/navdata_gyros_offsets
subscribed to [/ardrone/navdata_gyros_offsets]
average rate: 15.322
    min: 0.055s max: 0.079s std dev: 0.00623s window: 15

mani-monaj added a commit that referenced this pull request Nov 27, 2012
Fixed bug with navdata handling & improved initialization
@mani-monaj mani-monaj merged commit c96e7d2 into AutonomyLab:dev-unstable Nov 27, 2012
@parcon
Copy link

parcon commented Dec 4, 2012

I am still seeing the bug where vectors endlessly grow in the latest dev-unstable. For instance, when looking at tags, the tags_xc vector grows with each new image (or so it seems).

@mikehamer
Copy link
Contributor Author

@parcon this was introduced in the last commit (5969064) when moving legacynavdata_msg to a member variable. This introduced the same problem as we had (and fixed) with the raw navdata packets.

I've fixed it (presumably) in #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants