-
Notifications
You must be signed in to change notification settings - Fork 205
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
Make Axes display use latest transform #892
Conversation
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woot! Just a small comment about existing docstrings.
Also, I'm surprised the ros2 docs mention a special tf2::TimePointZero
, but it seems like other uses either use rclcpp::Time()
or rclcpp::Time(0, 0, clock_->get_clock_type())
(as is done in FrameManager::getTransform
.
https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Learning-About-Tf2-And-Time-Cpp.html#tf2-and-time
What is the correct things to do? I see usages of both when searching through vcs import < ros2.repos
for Humble.
EDIT: Yeah, I see tf2::TimePointZero
, rclcpp::Time()
, and various flavors of rclcpp::Time(0, 0...)
Is there already an issue for this? If not, probably good to file.
@@ -102,7 +102,7 @@ void AxesDisplay::update(float dt, float ros_dt) | |||
Ogre::Vector3 position; | |||
Ogre::Quaternion orientation; | |||
if (context_->getFrameManager()->getTransform( | |||
frame, context_->getClock()->now(), position, orientation)) | |||
frame, position, orientation)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit (pre-existing) Documentation for this function seems insufficient:
rviz/rviz_common/include/rviz_common/frame_manager_iface.hpp
Lines 152 to 165 in 4e976dc
/// Return the pose for a frame relative to the fixed frame, in Ogre classes, at a given time. | |
/** | |
* \param[in] frame The frame to find the pose of. | |
* \param[out] position The position of the frame relative to the fixed frame. | |
* \param[out] orientation The orientation of the frame relative to the | |
* fixed frame. | |
* \return true on success, false on failure. | |
*/ | |
virtual | |
bool | |
getTransform( | |
const std::string & frame, | |
Ogre::Vector3 & position, | |
Ogre::Quaternion & orientation) = 0; |
Is it possible to update that docstring to mention it's effectively using TimePointZero
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated docs in #893
Also, is there a way to encourage / ensure all plugins generally use the time-point-zero overload? |
I think there are a couple things leading to
I can document that plugins without a |
Gotcha! Is that documented somewhere discoverable on docs.ros2.org?
Sounds good! |
RViz's Frame manager being pluggable is documented at https://index.ros.org/r/rviz/github-ros2-rviz/#pluggable-transformation-library . I didn't find any documentation for it on docs.ros2.org. It also links to an RViz plugin development guide here: https://github.com/ros2/rviz/blob/humble/docs/plugin_development.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok on green CI! Remember to merge this along #893 !
thanks for the links! filed issue for time being -> #894 |
https://github.com/Mergifyio backport humble galactic foxy |
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> (cherry picked from commit 8dc9f8a)
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> (cherry picked from commit 8dc9f8a)
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> Signed-off-by: Shane Loretz <sloretz@osrfoundation.org> (cherry picked from commit 8dc9f8a)
✅ Backports have been created
|
This makes the Axes display use the latest transform data, just like it did in ROS 1.
The problem with trying to get the transform at
now()
is the transform message was created in the past. Looking up the transform at the current time produces an error message about extrapolating into the future (assuming clocks are synchronized and the transform isn't future-dated).To reproduce the bug this fixes:
Axes
displayvia_tf
in theAxes
display