treat tf parent as child
Hi everybody,
I am using the april_tag_ros package where I get a tf
Frame usb_cam -->tag_2
. While the camera is detecting a apriltag.
I want to have a tf-tree where the transform world --> camera1
equals tag_2 --> usb_cam
.
I tried it with static_transform_publisher
that world-->tag2
and usb_cam-->camera1
but than the connection between usb_cam
and tag_2
get lost (means when I run rosrun tf tf_view
there is no direkt connection between usb_cam
and tag_2
).
I read that for getting the inverse Frame from a --> b
I can use tf tf_echo b a
. So I tried that with static_transform_publisher
but here I lost another connection.
Can somebody help me?
Greetings
Edit1: Probably I have to write a short skript which listens to the transform usb_cam-->tag_2 and publish the inverse as the transform world-->camera1. Does tf have an inverse-matrix-modul for c++? I read that this exist in tf2. Actually my packages are working with tf. What is easiest way to programm that?
To start with, I don't understand why you want to connect
tag_2
with the world, why the camera would be a child of the tag, and how a connection "gets lost". Surely your camera is still publishing the transform from the camera from the tag?Is your camera fixed to a mobile base or is it also fixed to the world?
@roberto: To clear that. I want to have a moveable camera (means fixed to a mobile base). But the Tag_2 is fixed to the world. This should update every time when the transform usb_cam -->tag_2 is updated.
@fvd: "get lost" means when I run rosrun tf tf_view there is no direkt connection between usb_cam and tag_2. When I stop the static_transform_publisher the connection is there again.
Probably I have to write a short skript which listens to the transform usb_cam-->tag_2 and publishs the inverse as the transform world-->camera1.