Skip to content

Commit

Permalink
refactor(multi_object_tracker): clean up noisy tf warning message on …
Browse files Browse the repository at this point in the history
…terminal (#2511)

* refactor(multi_object_tracker): clean noisy tf warning message

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

* enable code

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>

Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
  • Loading branch information
TakaHoribe authored Dec 17, 2022
1 parent c7d3b7d commit fc1d820
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ boost::optional<geometry_msgs::msg::Transform> getTransformAnonymous(
const std::string & target_frame_id, const rclcpp::Time & time)
{
try {
// check if the frames are ready
std::string errstr; // This argument prevents error msg from being displayed in the terminal.
if (!tf_buffer.canTransform(
target_frame_id, source_frame_id, tf2::TimePointZero, tf2::Duration::zero(), &errstr)) {
return boost::none;
}

geometry_msgs::msg::TransformStamped self_transform_stamped;
self_transform_stamped = tf_buffer.lookupTransform(
/*target*/ target_frame_id, /*src*/ source_frame_id, time,
Expand Down

0 comments on commit fc1d820

Please sign in to comment.