0
$\begingroup$

Rosanswers logo

Hi everyone!

I am trying to use the package "GMapping" to visualize the map acquired with Hokuyo laser scanner!

I have no odometry, so I simulated a TF with a launch file, which worked already in other applications!

<launch>

  <node pkg="tf" type="static_transform_publisher" name="US6" args="0 7 2 1.5708 0 0 base_link laser 100" />

</launch>

When running RViz, in Global Options, the Fixed frame is map; In Grid, the Reference Frame is map; In TF I have the following warnings: No transform from [map] to [base_link] / No transform from [odom] to [base_link] In map, the topic is map and I receive this warning and error message: No map received / No transform from [] to [base_link]

What did I do wrong? I notice that if I change the Fixed Frame in Global Options and the one in Grid, the error disappear and some other errors appear... what are the correct options to be selected in Global Options and in Grid?

Thank you for your time!


Originally posted by anamcarvalho on ROS Answers with karma: 123 on 2014-08-28

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

As bvbdort already mentioned, you need to also publish the base_link -> odom transform. If you don't have an odometry system, you can do it with a static transform publisher in your launch file like this:

<launch>
  <node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="0 0 0 0 0 0 odom base_link 100" />
  <node pkg="tf" type="static_transform_publisher" name="US6" args="0 7 2 1.5708 0 0 base_link laser 100" />
</launch>

That way every transform gmapping expects to run is set up. Mind that gmapping won't really be able to extimate the position of the laser in the map, since you publish odometry information manually as a static transformation. But at least you should see a map built from your laser.

PS: If it still doesn't work that way, please provide info about what gmapping prints out.


Originally posted by Malefitz with karma: 136 on 2014-09-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by anamcarvalho on 2014-09-02:
Thank you Malefitz, it works =) now I have another question but i'll open a new one, since it isn't related with the transforms!

$\endgroup$
0
$\begingroup$

Rosanswers logo

For gmapping you also need transform between baselink and odom

Required tf Transforms

<the frame attached to incoming scans> → base_link

usually a fixed value, broadcast periodically by a robot_state_publisher, or a tf static_transform_publisher.

base_link → odom

usually provided by the odometry system (e.g., the driver for the mobile base)


Originally posted by bvbdort with karma: 3034 on 2014-08-29

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by anamcarvalho on 2014-08-31:
@bvbdort Since I don't have odometry, the second transform was the one I "simulated".

For the first one, does this exact transform in the tf static_transform_publisher ros page solves? (next comment)

Comment by anamcarvalho on 2014-08-31:

what do I write in link1_broadcaster, link1_parent and link1?

Comment by bvbdort on 2014-08-31:
base_link --> odom is not static you cant simulate this from static_transform_publisher.

Comment by anamcarvalho on 2014-08-31:
But isn't that the one I already simulate?

Comment by bvbdort on 2014-08-31:
static_transform_publisher you showed in question is between laser and base link

Comment by Malefitz on 2014-09-02:
For testing purposes it is ok to publish the odometry with a static publisher. I'll write an answer for it.

Comment by anamcarvalho on 2014-09-02:
Thank you @Malefitz, really appreciate it!

$\endgroup$

Your Answer

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