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

fixing tf warnign for ground truth mode #454

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class GroundTruthLocalizerNodelet : public ff_util::FreeFlyerNodelet {
void PublishLocState(const localization_common::Time& timestamp);

std::string platform_name_;
ros::Time last_time_;
boost::optional<Eigen::Isometry3d> pose_;
boost::optional<Twist> twist_;
int input_mode_ = ff_msgs::SetEkfInputRequest::MODE_TRUTH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ void GroundTruthLocalizerNodelet::PublishLocState(const lc::Time& timestamp) {

// Also publish world_T_body TF
const auto world_T_body_tf = lc::PoseToTF(*pose_, "world", "body", timestamp, platform_name_);

// If the rate is higher than the sim time, prevent repeated timestamps
if (world_T_body_tf.header.stamp == last_time_) return;
last_time_ = world_T_body_tf.header.stamp;

transform_pub_.sendTransform(world_T_body_tf);
}
} // namespace ground_truth_localizer
Expand Down