Skip to content

Commit

Permalink
Fix map display for moving TF frame (#483) (#579)
Browse files Browse the repository at this point in the history
Instead of the current time, use Time(0) to get the latest available transform as a fallback.
This is the same logic that is applied in RViz from ROS 1.

Resolves #332

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron authored Jul 22, 2020
1 parent b63b096 commit d9345fb
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,11 @@ void MapDisplay::transformMap()

Ogre::Vector3 position;
Ogre::Quaternion orientation;
if (!context_->getFrameManager()->transform(frame_, transform_time, current_map_.info.origin,
position, orientation) &&
!context_->getFrameManager()->transform(frame_, context_->getClock()->now(),
current_map_.info.origin, position, orientation))
if (!context_->getFrameManager()->transform(
frame_, transform_time, current_map_.info.origin, position, orientation) &&
!context_->getFrameManager()->transform(
frame_, rclcpp::Time(0, 0, context_->getClock()->get_clock_type()),
current_map_.info.origin, position, orientation))
{
setMissingTransformToFixedFrame(frame_);
scene_node_->setVisible(false);
Expand Down

0 comments on commit d9345fb

Please sign in to comment.