Skip to content

Commit

Permalink
Add fallback when TF tree for laserscan is not published
Browse files Browse the repository at this point in the history
  • Loading branch information
dom-lee committed Nov 4, 2023
1 parent 70c5542 commit 7d5b216
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/navigation/navigation_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ void RetrieveTransform(const std_msgs::Header& msg,
transform.getRotation().getY(),
transform.getRotation().getZ());
} catch (tf::TransformException& ex) {
ROS_ERROR("%s", ex.what());
ROS_WARN("Failed to retrieve transform from '%s' to '%s': %s",
msg.frame_id.c_str(), CONFIG_laser_frame.c_str(), ex.what());
ROS_INFO("Assuming '%s' frame is equal to '%s' frame;",
msg.frame_id.c_str(), CONFIG_laser_frame.c_str());
// Set frame_tf to identity as a fallback.
frame_tf = Eigen::Affine3f::Identity();
}
}

Expand Down

0 comments on commit 7d5b216

Please sign in to comment.