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

The topic /tf doesn't publish frame ID "camera" pose.

asked 2021-06-26 04:47:13 -0500

mingchi gravatar image

As the title says,I'm using the Apriltag on ROS to localization , the /tf has publish the pose with "camera"->"tag_id" and "camera"->"my_bundle", and the rviz is worked well("camera" is the parents frame ID , "tag_id" and "my_bundle" is the child frame ID).

And this is the problem, how can I get the "camera" pose shown in the Figure(red line) , Instead of the my_bundle ("camera"->"my_bundle") pose(orange line).

This is the Figure file: https://drive.google.com/file/d/1cq6A...

with kind regards, Mingchi

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-26 14:58:51 -0500

Mike Scheutzow gravatar image

The /tf_static topic carries additional transform data. I'll assume you are using rospy. There are routines in the tf2_ros package that calculate the transform between any two frames, or calculate a pose in a specified frame. For example, look at:

m = tf_buffer.lookup_transform(parent, child, time)
edit flag offensive delete link more

Comments

I'm using roscpp , and I tried : listener.waitForTransform("camera", "my_bundle", ros::Time(0), ros::Duration(3.0)); listener.lookupTransform("camera", "my_bundle", ros::Time(0), transform);

but terminal always call back :

"camera" passed to lookupTransform argument target_frame does not exist.

However, the "camera" is acturly exist.

mingchi gravatar image mingchi  ( 2021-06-26 22:25:03 -0500 )edit

In the rviz image you posted, frame "camera" has no parent frame. This implies that it is not connected to the rest of the transform tree.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-06-27 07:23:36 -0500 )edit

As you said, "camera" has no parent frame ID, but my TF tree only has "camera", "tag_ID" and "my_bundle", and "camera" is the parent of "tag_ID" and "my_bundle".

This means that the "camera" cannot use lookupTransform?

I use sendtransform to know the "my_bundle" and the "camera" TF, but as the figure you saw, the published TF doesn't mean the posture of "camera" when the fixed frame is "my_bundle".

So how do I know the posture of the "camera" when the fixed frame is "my_bundle"?

mingchi gravatar image mingchi  ( 2021-06-27 07:47:36 -0500 )edit

Your original question was how to get the pose of "camera" frame. It doesn't really make sense to ask for the pose (more accurately: transform) of the frame at the top of the TF tree.

Regarding your lookupTransform() call, it looks ok to me, assuming the necessary data has actually been published on /tf or /tf_static since you started the node. You need to be careful of what you see in rviz, which will cache previously-published transforms that are no longer being published; in that situation the lookupTransform() call will fail. You can clear the rviz cache by clicking the "Reset" button in the lower left corner of rviz.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-06-27 12:09:10 -0500 )edit

"Your original question was how to get the pose of "camera" frame. It doesn't really make sense to ask for the pose (more accurately: transform) of the frame at the top of the TF tree."

I didn't phrase this well. Please ignore these two sentences.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-06-27 12:19:40 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-06-26 04:47:13 -0500

Seen: 782 times

Last updated: Jun 26 '21