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

Run/create a first fixed frame with NO_PARENT

asked 2012-10-07 05:03:49 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello and first thanks for reading,

as I'm quite new in ros, and quite completely new in tf package, my problem was the next, I wanted to use tf package to transform a point cloud(with position changing in time) with reference to world(0,0,0). I have seen the tf tutorials, that helps to create frames starting by frames added by turtlesim, and that package creates the firsts frames, so I couldn't be able to understand how it have been done.

So I wanted to create or run the world frame, with NO_PARENT, but I didn't want turtlesim package to do this because it runs 2 nodes more(at least keeping the tutorials of tf: http://www.ros.org/wiki/tf/Tutorials) and I didn't wanted to add rubbish that I would have not used,

would it be possible to just run or add a world frame with no others frames, so I could then add a just the frames I interest??

For putting you in scene I have used a moving "robot" with a gps(using gpsd_client package) and a laser(using hokuyo_node package) fixed on the robot, and I would like to transform the scan point cloud to have every scan done (by laser) with the position(given by gps) where it has been scanned, so I need just 2 frames, the world frame (reference frame, I think it should be the (0,0,0)) and a frame with defines the scan position (with the same position as provided by gps), that would be changing in time according to the robot moves.

As I asked and according to Lorenz recommendations(sorry for before and hope it would be better now), I keep the question edited with question and you will see the answer by Lorenz down this question, that was if someone could help me at least to run or add a simple fixed frame world and I could continue with adding the target moving frame. Althought adding the moving frame should be the difficult and not the world frame, I had found some tutorials to do this that I could try to check, but according to easy question add a fixed world frame, I have not found the solution althought finding a lot.

So if you had the same problem just read now Lorenz answer, if I understood well (still couldn't try it) it's been done automatically when you send any transform, if the parent frame doesn't exist it's been create automatically as a NO_PARENT frame (0,0,0). In any case read his post to better understand.

Excuse my english and again thank you very much for your patience,

special thanks for you Lorenz!

Pablo Payno

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-10-08 02:58:50 -0600

Lorenz gravatar image

updated 2012-10-09 22:25:41 -0600

I guess you will have to set up a pretty simple TF tree. Instead of just two frames, I would actually use three: /world -> base_link -> sensor

In tf, you basically just specify the relation between a parent and a child frame, i.e. your system need to publish only two transforms: /world -> base_link and base_link -> sensor. If the sensor is not moving relative to the robot, i.e. if it is fixed on the robot, you can run a static_transform_publisher node. The transform /world -> base_link must be published by your gps node or whatever node is globally localizing your robot. Have a look at the broadcasting tutorial for examples.

Edit: I feel like you have a misconception regarding how the TF tree is constructed. In TF, not the nodes of the TF tree, i.e. the frames are sent over the TF topic but the relation between nodes. So if you send only one single transform with frame id world and child frame id base_footprint, the system creates two nodes where the root is world. world then of course does not have a parent and is the global reference frame. In other words, world is at (0, 0, 0) in world.

In your case, you said already that you have a node that computes the localization of your robot (translation and rotation) from gps data. Just use that transformation and publish it with frame id world and child frame id base_link or whatever you want to use for your robot's base. I would still add the sensor as a static transform because it makes the tree self-explanatory, in particular because you won't have to let the sensor driver its data in the robot's base frame but a separate sensor frame.

edit flag offensive delete link more

Comments

and how can i do this? i have the same problem: i have an indoor localization system (marvelmind), which gives me the localization of my ARDrone 2.0... And i would like to transform the destination localization to the drone's coordinate frame.

Steve_RosUsr gravatar image Steve_RosUsr  ( 2018-02-02 03:04:42 -0600 )edit

There is no tutotrial which expains how to create the world frame from the indoor localization system data

Steve_RosUsr gravatar image Steve_RosUsr  ( 2018-02-02 03:36:27 -0600 )edit

Question Tools

Stats

Asked: 2012-10-07 05:03:49 -0600

Seen: 7,474 times

Last updated: Oct 29 '12