Ask Your Question
0

[rviz] tf and Interactivemarker: pose with respect to which frame?

asked 2014-03-11 06:34:08 -0500

courrier gravatar image

Hi all,

I wonder in which frame the interactive_marker.pose field is expressed? It seems relative to interactive_marker.header.frame_id but even considering that hypothesis, I get a strange behaviour. Let me explain...

I'm writing an application were several parts of furniture (leg, back of a chair...) are represented in RViz has interactive markers.

Each part is relative either to the world or to another part and all of them publish their transform with a TransformBroadcaster. view_frames gives: view_frames result

It seems that InteractiveMarker.pose designates the coordinates of the IM with respect to the frame InteractiveMarker.header.frame_id so when I set a new frame_id for an existing object I recompute the InteractiveMarker.pose with respect to the new frame_id, so that the pose doesn't move in the world frame. This works well, the new coordinates are computed with respect to the new frame thanks to a tfListener and there are correct.

When I move the parent frame with RViz, the child frame also moves because the pose of the child doesn't change with respect to the parent and this is exactly want I want.

Except that, when I click on the child object it's suddenly teleported elsewhere. I have disabled all callbacks for the Interactive Marker, so the server does that on its own But I don't know why. The transformation applied to the object is not random, it is exactly the transformation from its parent to the world.

Here is as exemple, I start with the interactive marker "leg1" at x=0 y=0 z=5 with respect to /world. I set it relative to /sitting which is at 0 0 -1 with respect to /world. The coordinates of "leg1" with respect to the world are computed by a tfListener and are 0 0 6, so I give these coordinates to leg1.pose.position = (0, 0, 6). Then when I click on "leg1" without moving it, it's teleported to 0 0 5 relative to /sitting, and if I click again 0 0 4, 0 0 3, and so on.

[ INFO] [1394553885.833971573]: leg1 is at 0 0 5 relative to /world
[ INFO] [1394553885.834646868]: [callback] leg1 set relative to sitting which is at 0 0 -1 relative to /world
[ INFO] [1394553885.848262357]: leg1 0 0 6 relative to /sitting
[ INFO] [1394553885.845737564]: [callback] leg1 is clicked (but not moved and no code is executed)
[ INFO] [1394553886.719846935]: leg1 0.10338 0.06199 6.96599 relative to /sitting (so almost 0 0 7)

It sounds like I forgot to set a "frame_id" somewhere to avoid the server to apply this automatic pose transformation. But I don't know where because if I server->get("leg1") the frame_id is actually set to "sitting".

I have been tearing my hear out on this issue for one week, but it's still unsolved and I don't know what to do with that :( I hope my explanations are understandable.

All clues are welcome, many thanks by advance ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-04-22 04:48:25 -0500

courrier gravatar image

Concerning this teleportation bug, I figured out that the it came from the control InteractiveMarkerControl::MOVE_ROTATE_3D. I don't know if it's faulty or if I don't use it properly but I could reproduce the bug easily by changing 1 line of code in the tutorial "basic control": http://www.diffchecker.com/x733vxw2

Replacing this control by another one solved my issue.

edit flag offensive delete link more

Comments

This diff doesn't exist anymore, can you please fix the link?

William gravatar imageWilliam ( 2015-10-21 14:28:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-03-11 06:34:08 -0500

Seen: 1,059 times

Last updated: Apr 22 '14