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

Frame problem when using with a third-party node

asked 2012-02-15 03:27:41 -0600

alfa_80 gravatar image

updated 2012-02-15 06:11:12 -0600

I'm using laser_scan_matcher node to be working with my node. The problem I'm now having is that I've my /world defined somewhere in my code. In laser_scan_matcher, I need to set the value for publish_tf as true, or else, it'll complaint. I can set publish_tf as true, but then, the output and the robot movement is really weird or wrong. Whenever I try to set the publish_tf as false, I receive the following serious warning:

[ WARN] [1329318619.876324732]: Warning: Frame id /world does not exist! Frames(3):Frame /laser exists with parent /base_link.
Frame /base_link exists with parent NO_PARENT.

Without the laser_scan_matcher node, my own node works out-of-the-box. I've also seen the code of laser_scan_matcher, they also define "world" frame. Do they clash? Any idea how to resolve this?

EDIT

In my broadcaster node:

static tf::TransformBroadcaster tfb;
tf::Transform xform;
xform.setOrigin(tf::Vector3(previous_poseLD2_.pose.position.x-starting_position_x, previous_poseLD2_.pose.position.y-starting_position_y, previous_poseLD2_.pose.position.z));
xform.setRotation(tf::Quaternion(previous_poseLD2_.pose.orientation.x, previous_poseLD2_.pose.orientation.y, previous_poseLD2_.pose.orientation.z, previous_poseLD2_.pose.orientation.w));
tfb.sendTransform(tf::StampedTransform(xform, ros::Time::now(), "/world", "/base_link"));

In another node:

tfListener_.waitForTransform("/world", "/laser", ros::Time::now(), ros::Duration(20.0));

On top of that, I have a static transform publisher from base_link to laser.

BTW, I'm specifically interested to use the pose information(x, y and delta) to be integrated with my node.

Here is the laser_scan_matcher xml:

 <node pkg="laser_scan_matcher" type="laser_scan_matcher_node" name="laser_scan_matcher_node" output="screen">  
   <param name="use_alpha_beta" value="true"/>     
   <param name="max_iterations" value="10"/>    
   <param name="publish_tf" value="false"/>   
 </node>
edit retag flag offensive close merge delete

Comments

How often does this warning appear? Is it only one time? Or is it continuous?

DimitriProsser gravatar image DimitriProsser  ( 2012-02-15 04:12:07 -0600 )edit

It's continuous but not frequent.

alfa_80 gravatar image alfa_80  ( 2012-02-15 05:16:15 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-02-15 04:13:33 -0600

updated 2012-02-15 04:17:44 -0600

Let's examine the frames laser_scan_matcher works with:

  • the sensor frame - typically this is "/laser"
  • the base frame - typically this is /base_link
  • the world frame - typically this is world (or sometimes odom)

The tf from the base frame to the sensor frame is assumed to be static. It should be published by a static TF publisher

The tf from the world frame to the base frame will be published by laser_scan_matcher, and will represent the moving pose of the robot in the world.

If you publish a tf from /world to /base_link in your code (and the publish_tf param is true), that will result in a conflict with the scan matcher, since base_link now has two parents.

I might be able to provide more help if you describe your usage scenario and what your node is doing.

edit flag offensive delete link more

Comments

I've updated as above. Thanks anyway for getting involved.

alfa_80 gravatar image alfa_80  ( 2012-02-15 04:29:18 -0600 )edit

I could see as well, it's kinda conflict. Previously, I got a 3D .point cloud, but after integrating your node, I got 2D cloud, and the robot was strangely moving.

alfa_80 gravatar image alfa_80  ( 2012-02-15 04:31:07 -0600 )edit

I think for the publish_tf param, I can set to false, because I don't need the one from your node I think. Anyway, I'm opened to any fix.

alfa_80 gravatar image alfa_80  ( 2012-02-15 04:38:55 -0600 )edit

Where is xform coming from (how is it computed)? Also, the can matcher is meant to work with laser data (2d). What 3d cloud do you have?

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2012-02-15 05:16:44 -0600 )edit

Kindly refer to EDIT part, because I've just added some more info.

alfa_80 gravatar image alfa_80  ( 2012-02-15 05:28:50 -0600 )edit

@Ivan Dryanovski: Should I set a fixed_frame param in the laser_scan_matcher's xml? At the moment, I didn't set it.

alfa_80 gravatar image alfa_80  ( 2012-02-15 06:12:36 -0600 )edit

previous_poseLD2_.pose.position.x is computed by taking the difference of the current and previous value of y-value of pose2D and accordingly for x-component. I integrate this difference value over time.

alfa_80 gravatar image alfa_80  ( 2012-02-15 09:27:47 -0600 )edit

Do I have some other frame conflict like, I defined static transform publisher(laser->base) differently from yours in terms of parameter values and so on?

alfa_80 gravatar image alfa_80  ( 2012-02-15 09:57:40 -0600 )edit
1

answered 2012-02-15 03:45:50 -0600

DimitriProsser gravatar image

laser_scan_matcher does not define the /world frame. By convention, the /world frame is never defined. laser_scan_matcher requires that a transform from /base_link exist. If you do not publish this transform, laser_scan_matcher can for you. This would represent the sensor's travel with respect to the world.

The frame /world is simply the default. If you would like to measure the robot's travel with respect to the /map frame, you only need to change the fixed_frame parameter. If you do not want to publish tf from laser_scan_matcher, simply change the fixed_frame to some static frame you use in your code (/map for example).

edit flag offensive delete link more

Comments

I defined already the transform of base_link with respect to world like this: " tfb.sendTransform(tf::StampedTransform(xform, ros::Time::now(), "/world", "/base_link"));"

alfa_80 gravatar image alfa_80  ( 2012-02-15 04:01:42 -0600 )edit

And from /laser wrt /world like this:"tfListener_.waitForTransform("/world", "/laser", ros::Time::now(), ros::Duration(20.0));" Am I missing anything else?

alfa_80 gravatar image alfa_80  ( 2012-02-15 04:03:04 -0600 )edit

@alfa_80: Those tf's will likely result in a conflict - see my answer

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2012-02-15 04:14:16 -0600 )edit

Question Tools

Stats

Asked: 2012-02-15 03:27:41 -0600

Seen: 838 times

Last updated: Feb 15 '12