Ask Your Question
1

Gmapping tf problem

asked 2016-04-28 03:57:56 -0500

stijn gravatar image

updated 2016-05-04 02:47:22 -0500

Hi,

We are having problems with Gmapping. We are using a OMD10M-R2000 range finder and are getting odometry via RS232 from the robot. In RViz we get the following error: No transform from [] to [map]

image description

when we start Gmapping with following launch file we get a warning: [ WARN] [1461833120.053747916]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.

launch file: EDIT: old launch file

 <launch>

<node pkg="pepperl_fuchs_r2000" type="r2000_node" name="r2000"  output="screen">
                <param name="scanner_ip" value="10.0.10.9"/>
                <param name="frame_id" value="/scan"/>
                <param name="scan_frequency" value="50"/>
                <param name="samples_per_scan" value="3600"/>
</node>



<arg name="scan_topic" value="r2000/scan" />
    <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">

      <param name="map_update_interval" value="5.0"/>
      <param name="maxUrange" value="16.0"/>
      <param name="sigma" value="0.05"/>
      <param name="kernelSize" value="1"/>
      <param name="lstep" value="0.05"/>
      <param name="astep" value="0.05"/>
      <param name="iterations" value="5"/>
      <param name="lsigma" value="0.075"/>
      <param name="ogain" value="3.0"/>
      <param name="lskip" value="0"/>
      <param name="srr" value="0.1"/>
      <param name="srt" value="0.2"/>
      <param name="str" value="0.1"/>
      <param name="stt" value="0.2"/>
      <param name="linearUpdate" value="1.0"/>
      <param name="angularUpdate" value="0.5"/>
      <param name="temporalUpdate" value="3.0"/>
      <param name="resampleThreshold" value="0.5"/>
      <param name="particles" value="30"/>
      <param name="xmin" value="-50.0"/>
      <param name="ymin" value="-50.0"/>
      <param name="xmax" value="50.0"/>
      <param name="ymax" value="50.0"/>
      <param name="delta" value="0.05"/>
      <param name="llsamplerange" value="0.01"/>
      <param name="llsamplestep" value="0.01"/>
      <param name="lasamplerange" value="0.005"/>

<param name="odom_frame" value="odom"/>


<param name="delta" value="0.05"/>
<param name="llsamplerange" value="0.01"/>
<param name="llsamplestep" value="0.01"/>
<param name="lasamplerange" value="0.005"/>
<param name="lasamplestep" value="0.005"/>
<remap from="scan" to="$(arg scan_topic)"/>

<!-- Map size / start point -->
<param name="map_resolution" value="0.025"/>
<param name="map_size" value="2048"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="laser_z_min_value" value="-2.5" />
<param name="laser_z_max_value" value="3.5" />
<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.7" />    
<param name="map_update_distance_thresh" value="0.2"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="pub_map_odom_transform" value="true"/>

    </node>

    <param name="robot_description" command="cat $(find urdf_agv)/src/my_agv.xml" />
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
    <node name="tf_broadcaster" pkg="urdf_agv" type="tf_broadcaster" />     

</launch>

Our tf tree looks like this: map->odom->base_link EDIT: old tf tree image description

Our rqt_graph:

EDIT: old rqt_graph

image description

Greetings,

Stijn

[EDIT] URDF file:

<robot name="agv">
  <link name="base_link" />
  <link name="scan_link" />

  <joint name="joint1" type="continuous">
    <parent link="base_link"/>
    <child link="scan_link"/>
<origin xyz="0 0 0" rpy="0 0 0" />
<axis xyz="0 0 0" />
  </joint>

</robot>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-04-28 04:45:07 -0500

mgruhler gravatar image

updated 2016-05-04 02:55:27 -0500

Yes, you need to add your laser scanner to the tf tree. Otherwise, gmapping cannot process the sensor data.

There is the Universal Robot Description Format URDF for this. Check out the tutorials there is everything described.


EDIT

You need to start use robot_state_publisher to publish the transfrom base_link->scan (I would rather rename scan to laser_link or r2000_link or similar).

Then, you need to add this link name to the frame_id of the scan. This allows the tf library to handle sensor data correctly.


EDIT2

You need to change the following line in the launch file where you start the r2000 driver from:

<param name="frame_id" value="/scan"/>

to

<param name="frame_id" value="scan_link"/>

This is how rviz determines which message comes in which frame.

edit flag offensive delete link more

Comments

Thanks for your answer! I made a file "my_agv.urdf" which you can view in my first post above. I don't see how this should link data from my base link to my scan data. I cant find any useful examples for making an URDF file for a 2D-laser scanner.

stijn gravatar imagestijn ( 2016-04-28 07:19:15 -0500 )edit

Oke, i added an URDF link and started the robot_state_publisher. I also added a node to connect base_link to scan_link. i still get the same error in rviz and warning in gmapping. I'll update my opening post.

stijn gravatar imagestijn ( 2016-05-04 02:35:48 -0500 )edit

Thanks, but when i modified /scan to scan_link i get an error: [slam_gmapping-2] process has died.... When i change <arg name="scan_topic" value="r2000/scan" /> to <arg name="scan_topic" value="scan_link" /> there is no error. But the r2000 driver is not connected to GMapping.

stijn gravatar imagestijn ( 2016-05-04 03:51:04 -0500 )edit

Is there a way to connect them and keep <arg name="scan_topic" value="scan_link" /> ?

stijn gravatar imagestijn ( 2016-05-04 03:51:52 -0500 )edit

The topic name and the frame_id are completely seperate! frame_id is part of the header of the scan message sent over the topic with name, in your case, r2000/scan!

Just change the frame_id, keep the topic as it is. Why it is crashing, I cannot say.

mgruhler gravatar imagemgruhler ( 2016-05-04 03:59:49 -0500 )edit

As comments say, you should change frame_id, not scan_topic. The point is that by setting frame_id to "scan", laserscans are being published in a frame reference that is not linked in the tf tree (i.e. there is no transformation for it), and thus you are getting the rviz error.

IvanV gravatar imageIvanV ( 2016-05-04 05:39:08 -0500 )edit

It works! I changed samples_per_scan from 3600 to 2880. No more error and gmapping starts mapping. Anybody an idea how to increase this?

Thanks for all the help!

stijn gravatar imagestijn ( 2016-05-04 07:13:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-28 03:57:56 -0500

Seen: 1,059 times

Last updated: May 04 '16