0
$\begingroup$

Rosanswers logo

hi ,

i'm trying to use gmapping with my own robot but get some troubles with the map ,i write all transformation (base link ,odom , laser ) but i don't understand how to write the TF between base_link and map i tried to use this : rosrun tf static_transform_publisher 0.0 0.0 0.0 0.0 0.0 0.0 1.0 base_link map 100 , it's seems that this one let the robot build the map but the map is wrong and on rviz i'm seing the odom frame move alone when the robot dont move can anyone what is the right tf between base_link and map ?

thank you in advance for your answers


Edit: this is my tf_tree

image description


Originally posted by kesuke on ROS Answers with karma: 58 on 2018-03-26

Post score: 0


Original comments

Comment by stevejp on 2018-03-26:
It would be useful if you posted a picture of your TF tree.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

[kesuke, I have only recently started understanding how to manipulate transforms. I enjoy working with them now but I do not consider myself an expert. I recently modified the driver for my INS (inertial navigation system) to output a transform for its pose. This was amazingly helpful and was the key to all of the progress I have made recently. I think I understand what you're asking from this perspective but please understand I'm still a novice in this area.]

The TF between /base_link and /map is the position and orientation of your robot with respect to the map. It is not static. It's likely that you'll get your position from wheel odometry or GNSS, and your orientation from an IMU or visual system.

I notice you have an odom frame so you might almost be done. I get my odometry from GNSS so my /odom is the pose of my antenna (fused with IMU data). I then make a static transform from the antenna to base_link (a spot on the ground in the middle of my tractor).

I suspect that you do not need to specify a TF between base_link and map. Instead, create a static transform between /odom (which is dynamic and likely defined with respect to /map or /world) and your base_link. For example, the origin of /odom might be the midpoint of an axle, and /base_link might be the center of mass of your robot.

Once you have the transform between /odom and /base_link, ROS will compute the transform between /map and /base_link.


Originally posted by kylerlaird with karma: 104 on 2018-03-26

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by kesuke on 2018-03-26:
kylerlaird thank you for your explanation, as you say i made the tf between /odm and base_link but when i run gamapping it's not building any map and i's says on rviz : No transform from [map] to frame [base_link] that's why i use tf static_transform_publisher

Comment by kylerlaird on 2018-03-26:
Does the tf_tree you posted represent your use of "rosrun tf static_transform_publisher 0.0 0.0 0.0 0.0 0.0 0.0 1.0 base_link map 100"? I don't see it.

Why does the odom->base_link TF have "0.0" for oldest and most recent? That seems wrong. Maybe RViz is waiting for a transform update?

Comment by kesuke on 2018-03-27:
thank for your answer you were right ros compute the transform between /map and /base_link , i found my mistake on the TF between /odom and /base_link i use this tutorial : http://wiki.ros.org/navigation/Tutorials/RobotSetup/Odom where odom.header.stamp = current_time instead ros::Time::now()

Comment by kesuke on 2018-03-27:
so now it's working thank you for your explanations it was helpful

$\endgroup$

Your Answer

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