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

How do I use collision_object.header.frame_id? Can I use it for frame transformations?

asked 2014-05-19 00:20:40 -0600

paturdc gravatar image

updated 2014-05-19 00:59:25 -0600

I want to add collision objects to the world using a frame that is broadcast by a node. Setting

collision_object.header.frame_id = "task_frame"

results in the planner responding that

Unable to transform from frame 'task_frame' to frame '/base_link'. Returning identity.

I tried setting my

collision_object.header.stamp = ros::Time::now();

but no luck. I know task_frame exists, because I can run through tf_echo just fine. I can also manually transform poses, but the code will soon become really ugly as the list of objects increases.

Am I using collision_object.header wrong?


edit retag flag offensive close merge delete


Can you upload on image of the tf using `$ rosrun tf view_frames $ evince frames.pdf` ? And I know its working but could you add the output of `rosrun tf tf_echo /map /odom` ?

Maya gravatar image Maya  ( 2014-05-19 00:32:58 -0600 )edit

I don't have /map or /odom transforms, are they required? I'm transforming directly from the base_link of the robot (which is stationary), to a particular configuration of the end_effector. I'll edit my question to include an image of the tf.

paturdc gravatar image paturdc  ( 2014-05-19 00:58:13 -0600 )edit

Weird, it suddenly stared working, I didn't change anything. I suppose there might be some suboptimal way I've set up my transforms/timing/planning_scene somewhere.

paturdc gravatar image paturdc  ( 2014-05-19 01:54:30 -0600 )edit

And now it is back where I started. I even added a wait for transform before setting my collision_object.header to prove to myself that the frame is coming through. Every node that I can think of can see "task_frame" except my planner. I'm out of ideas.

paturdc gravatar image paturdc  ( 2014-05-19 03:21:29 -0600 )edit

It's probably a typo somewhere but when I look at your image, I don't see any task_frame, I see task_space...

Maya gravatar image Maya  ( 2014-05-19 05:12:22 -0600 )edit

Yeah, it's a type in the question. But everything is spelled correctly in the code. I imagine it has to do with the timestamp, embedded in the collision_object, but I can't find a solution that works.

paturdc gravatar image paturdc  ( 2014-05-19 06:12:16 -0600 )edit

Ok osrry it's the end of my knowledge. I have no idea why it does not work :/

Maya gravatar image Maya  ( 2014-05-20 19:23:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-05-21 01:00:57 -0600

paturdc gravatar image

It turns out that restarting the planner after the new transform has been published does the trick. I suppose it loads a list of transforms to subscribe to, and doesn't update that list after it has been started. Thanks for the help, it did at least clear up that I was on the right track :)

edit flag offensive delete link more


Hey! Just realize by you saying it actually doesn't actualize the transformation loaded. I don't think it's a normal behavior of the system. Are you, by any chance doing something as describe here : ?

Maya gravatar image Maya  ( 2014-05-21 02:41:38 -0600 )edit

Yes, it looks like it is the same kind of problem. I can't tell if this is undesired behaviour from ROS or if I just need to make sure that things are running in the correct sequence. It is impossible to change the sequence in certain applications for me.

paturdc gravatar image paturdc  ( 2014-05-21 03:03:05 -0600 )edit

Last attempt to understand : is your roscore launch in a independant terminal ? =)

Maya gravatar image Maya  ( 2014-05-21 03:14:37 -0600 )edit

Yes, I have multiple terminals, and my subscriber is launched in a different terminal than my publisher (and the subscriber is launched before the publisher).

paturdc gravatar image paturdc  ( 2014-05-21 03:31:36 -0600 )edit

Question Tools

1 follower


Asked: 2014-05-19 00:20:40 -0600

Seen: 1,192 times

Last updated: May 21 '14