Skip to content

Commit

Permalink
plugin: vision_position: Add transform timestamp check.
Browse files Browse the repository at this point in the history
Issue #60.
  • Loading branch information
vooon committed Jul 28, 2014
1 parent 0d73430 commit ad932e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plugins/vision_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class VisionPositionPlugin : public MavRosPlugin,
std::string child_frame_id;

double tf_rate;
ros::Time last_transform_stamp;

/* -*- low-level send -*- */

Expand Down Expand Up @@ -129,6 +130,15 @@ class VisionPositionPlugin : public MavRosPlugin,
tf::Matrix3x3 orientation(transform.getBasis());
orientation.getRPY(roll, pitch, yaw);

/* Issue #60.
* Note: this now affects pose callbacks too, but i think its not big deal.
*/
if (last_transform_stamp == stamp) {
ROS_DEBUG_THROTTLE_NAMED(10, "position", "Vision: Same transform as last one, dropped.");
return;
}
last_transform_stamp = stamp;

// TODO: check conversion. Issue #49.
vision_position_estimate(stamp.toNSec() / 1000,
position.y(), position.x(), -position.z(),
Expand Down

0 comments on commit ad932e1

Please sign in to comment.