diff options
author | Daniel Agar <daniel@agar.ca> | 2015-03-27 19:08:44 -0400 |
---|---|---|
committer | Daniel Agar <daniel@agar.ca> | 2015-03-27 23:38:58 -0400 |
commit | 8aae66b893444c74a22ad7beb89e3828e0444108 (patch) | |
tree | 893833e818d8138360f8fa0bf5554dc6b036f369 /src/platforms/ros/nodes/position_estimator | |
parent | 5cc1a5dfdae53626c3cdf35e3d7b60f1a4ca68ed (diff) | |
download | px4-firmware-8aae66b893444c74a22ad7beb89e3828e0444108.tar.gz px4-firmware-8aae66b893444c74a22ad7beb89e3828e0444108.tar.bz2 px4-firmware-8aae66b893444c74a22ad7beb89e3828e0444108.zip |
trivial code style cleanup round 2
Diffstat (limited to 'src/platforms/ros/nodes/position_estimator')
-rw-r--r-- | src/platforms/ros/nodes/position_estimator/position_estimator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platforms/ros/nodes/position_estimator/position_estimator.cpp b/src/platforms/ros/nodes/position_estimator/position_estimator.cpp index ed3a4efa5..e4273687e 100644 --- a/src/platforms/ros/nodes/position_estimator/position_estimator.cpp +++ b/src/platforms/ros/nodes/position_estimator/position_estimator.cpp @@ -64,14 +64,16 @@ void PositionEstimator::ModelStatesCallback(const gazebo_msgs::ModelStatesConstP /* Fill px4 position topic with contents from modelstates topic */ int index = 0; + //XXX: maybe a more clever approach would be to do this not on every loop, need to check if and when //gazebo rearranges indexes. - for(std::vector<std::string>::const_iterator it = msg->name.begin(); it != msg->name.end(); ++it) { + for (std::vector<std::string>::const_iterator it = msg->name.begin(); it != msg->name.end(); ++it) { if (*it == "iris" || *it == "ardrone") { index = it - msg->name.begin(); break; } } + msg_v_l_pos.xy_valid = true; msg_v_l_pos.z_valid = true; msg_v_l_pos.v_xy_valid = true; |