0
$\begingroup$

Rosanswers logo

Hi all,

I wrote a program to move my urdf model around Rviz. It works fine when I have /odom (xyz yaw) on Fixed Frame and /base_link (principal link of my urdf model) on Target Frame thanks to this tutorial.

I would like to add a point cloud from a Kinect but when I add a point cloud with any topics from the /openni_camera, I have an error on my pointcloud2 topic:

No transform to fixed frame [/odom]. TF error: [Unable to lookup transform, cache is empty, when looking up transform from frame [/openni_rgb_optical_frame] to frame [/odom]]

That is quite understandable but how can I add a point cloud if I want to move my robot? Should I send everything on the same topic? kind of messy and not even sure it will work...

Thank you for giving me any leads

Brioche


Originally posted by Brioche on ROS Answers with karma: 115 on 2012-09-19

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You need a valid tf tree that also contains the frame /openni_rgb_optical_frame. This is normally done by creating a urdf file of your robot (have a look at these tutorials) and running the robot_state_publisher. The state publisher will read your urdf file and publish the links in it as tf frames. Then rviz will visualize the point cloud in the right frame.


Originally posted by Lorenz with karma: 22731 on 2012-09-19

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Brioche on 2012-09-20:
Yes but I also make my robot move by publishing its position on /odom (http://ros.org/wiki/urdf/Tutorials/Using%20urdf%20with%20robot_state_publisher) so I don't understand how I can connect my /odom and /openni_rgb_optical_frame ... When I read tf it's not really clear for me... sorry

Comment by bit-pirate on 2012-09-20:
I assume the node for publishing your odometry information is publishing a transform from /odom to your robot's root link, e.g. /base_link. As Lorenz says, you then need to have a transform from the point cloud's reference frame (e.g. /openni_rgb_optical_frame) to your robot's root frame. ...

Comment by bit-pirate on 2012-09-20:
You can do this by using the mentioned robot_state_publisher in combination with a URDF file. Or, for a simple test, you can also use the static transform publisher to publish the transform robot's root frame -> point cloud's reference frame

Comment by bit-pirate on 2012-09-20:
RViz will combine the provided information to visualise the point cloud linked to the moving robot.

Comment by Brioche on 2012-10-01:
Thanks, so if I well understood, I should modify my cpp to have /optical_..._frame as my header.frame_id and odom and base_link as child_frame_id. (according to the robot state publisher tuto) I will try it tomorrow

Comment by Lorenz on 2012-10-01:
It is ok to set openni_optical_frame as header.frame_id of your point cloud. But make sure that your urdf file contains a link that is also named openni_optical frame. Then make sure you run the robot_state_publisher node. It will publish a tf tree generated from your urdf.

Comment by Brioche on 2012-10-04:
For the curious: I've tranformed my /odom in /openni_rgb_optical_frame and not my base_link this /odom was my header.id and now I have my robot moving and my kinect point cloud! Thanks a lot bit-pirate and Lorenz

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.