0
$\begingroup$

Rosanswers logo

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> 

Originally posted by alfa_80 on ROS Answers with karma: 1053 on 2012-02-15

Post score: 0


Original comments

Comment by DimitriProsser on 2012-02-15:
How often does this warning appear? Is it only one time? Or is it continuous?

Comment by alfa_80 on 2012-02-15:
It's continuous but not frequent.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Ivan Dryanovski with karma: 4954 on 2012-02-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by alfa_80 on 2012-02-15:
I've updated as above. Thanks anyway for getting involved.

Comment by alfa_80 on 2012-02-15:
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.

Comment by alfa_80 on 2012-02-15:
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.

Comment by Ivan Dryanovski on 2012-02-15:
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?

Comment by alfa_80 on 2012-02-15:
Kindly refer to EDIT part, because I've just added some more info.

Comment by alfa_80 on 2012-02-15:
@Ivan Dryanovski: Should I set a fixed_frame param in the laser_scan_matcher's xml? At the moment, I didn't set it.

Comment by alfa_80 on 2012-02-15:
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.

Comment by alfa_80 on 2012-02-15:
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?

Comment by Ivan Dryanovski on 2012-02-15:
Is there any reason to take the difference and then integrate? This would just give you the pose that the laser publishes. Are you trying to remove a constant initial offset?

Comment by alfa_80 on 2012-02-15:
"This would just give you the pose that the laser publishes.." yes, I use this pose to be integrated with my initial pose. Any idea to resolve this frame conflict?

Comment by Ivan Dryanovski on 2012-02-16:
Have the scan_matcher publish a pose, but not a tf (by setting the params). Then (in your node) subscribe to the pose message, do your calculations, and publish a tf. This way, only one world->base_link tf is published, and there are no conflicts.

Comment by alfa_80 on 2012-02-16:
I did the step you suggested, but, it still ends up with this error message "[ WARN] [1329401873.937791965]: Warning: Frame id /world does not exist! Frames (3): Frame /laser exists with parent /base_link. Frame /base_link exists with parent NO_PARENT."

Comment by alfa_80 on 2012-02-16:
I think I have a problem with setting the /world frame id. I'll resolve this one first.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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).


Originally posted by DimitriProsser with karma: 11163 on 2012-02-15

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by alfa_80 on 2012-02-15:
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"));"

Comment by alfa_80 on 2012-02-15:
And from /laser wrt /world like this:"tfListener_.waitForTransform("/world", "/laser", ros::Time::now(), ros::Duration(20.0));" Am I missing anything else?

Comment by Ivan Dryanovski on 2012-02-15:
@alfa_80: Those tf's will likely result in a conflict - see my answer

$\endgroup$

Your Answer

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