ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Poses Arithemetic

asked 2021-11-30 03:16:15 -0500

amit_z gravatar image

updated 2022-04-30 13:54:23 -0500

lucasw gravatar image

Let's say I have a PoseStamped in frame 'base_link'. Now I want to do Poses arithmetic: I have a different pose that I know its relations to the previous pose and I want to get its position and orientation in frame 'base link'. An option to do it is to broadcast the first Pose as a frame in tf2_ros.TransformBroadcaster() and than use transformPose. But is there an elegant way to do it without publishing the first pose as a frame?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-30 14:05:26 -0500

lucasw gravatar image

You don't have to publish the frame out (and then have to wait with the tf subscriber to get what you already know returned back to you), you can create a local tf2 BufferCore and set needed transforms within it then query their relationship as if it was a tf listener buffer. This will be faster, and if you already know how to do tf lookups you can continue to use that interface, avoid any error prone transform math in your node (though you have to be careful with the initial setting of transforms still).

For your particular problem you convert your Poses into Transforms and set them into the buffer core, and you could do a regular tf listener lookup between your base_link and pose1 and set that into the buffer_core, then set your pose1->pose2 transform, after that you can look up base_link->pose2. You could make all the transforms static if nothing is changing over time for the duration you care about.

There isn't a ton of documentation or examples but I've made this (maybe a handful of other answers here): https://github.com/lucasw/tf_demo/blo...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-11-30 03:16:15 -0500

Seen: 95 times

Last updated: Apr 30 '22