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

Yet another problem with robot_localization and amcl

asked 2017-03-08 08:50:39 -0500

Julio Aguilar gravatar image

updated 2017-05-19 05:37:33 -0500

Hi there,

I've read several threads about robot_localization with amcl and odometry data, but I have not being able to make it work.

What I did:

  • amcl config file:

    tf_broadcast: false
    
  • ekf config file

    publish_tf: true
    map_frame: "/map"
    odom_frame: "/base_odom_link"
    base_link_frame: "/base_footprint_link"
    world_frame: "/map"
    odom0: "/dev/odom"
    pose0: "/amcl_pose"
    

The odometry/filtered topic is almost the same as the /dev/odom, which means it is filtering the odom_frame. This looked to me as if the ekf could not read the config file and went to its default settings. But I checked the rqt_graph and it listens to the right odom and pose topic.

If a set the tf_broadcast of the amcl to true. The scan matches in RVIZ jump between the amcl and ekf tf, which is somehow the same as odom.

What am I missing?

Edit 1: in response to comments from @Nicholash Bedi

odom0_config: [true,  true,  false,
               false, false, true,
               true, true, false,
               false, false, true,
               false, false, false]
odom0_differential: true
odom0_relative: false

pose0_config: [true,  true,  false,
               false, false, true,
               false, false, false,
               false, false, false,
               false, false, false]
pose0_differential: false
pose0_relative: false

Edit 2: uploaded pics of my config files.

Hopefully you can see the error.

ekf_config.jpg

amcl_config.jpg

Edit 3 In response to @Tom Moore -> output of rostopic echo /amcl_pose and /dev/odom. I am sorry for the very very late response

odom

header: 
  seq: 161063
  stamp: 
    secs: 1495189822
    nsecs: 753257722
  frame_id: base_odom_link
child_frame_id: base_footprint_link
pose: 
  pose: 
    position: 
      x: -0.0955580770969
      y: -0.127791434526
      z: 0.0
    orientation: 
      x: 0.0
      y: -0.0
      z: -0.00566518455002
      w: -0.999983952713
  covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
twist: 
  twist: 
    linear: 
      x: 0.0
      y: 0.0
      z: 0.0
    angular: 
      x: 0.0
      y: 0.0
      z: 0.0
  covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

amcl

header: 
  seq: 185
  stamp: 
    secs: 1495187483
    nsecs: 905225829
  frame_id: /map
pose: 
  pose: 
    position: 
      x: 2.232329958
      y: 4.91519891085
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.692934073576
      w: 0.721000949845
  covariance: [0.0028978789516864722, -0.0026280780170626628, 0.0, 0.0, 0.0, 0.0, -0.0026280780170626628, 0.018904477044003443, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0 ...
(more)
edit retag flag offensive close merge delete

Comments

What are your pose/odom config, differential, and relative set to?

Nicholash Bedi gravatar image Nicholash Bedi  ( 2017-03-08 09:32:52 -0500 )edit

Can you paste (a) your full launch/config files, and (b) sample messages from every input? Thanks!

Tom Moore gravatar image Tom Moore  ( 2017-04-11 04:57:21 -0500 )edit

(Just a heads-up: you have two sources of pose data measuring X and Y, and they are not going to agree).

Tom Moore gravatar image Tom Moore  ( 2017-04-11 04:58:00 -0500 )edit

Hi Tom, thx for the help. I noticed from the debug file (didn't look at the code) that the ekf node changes the frame ids from '/map' to 'map' and tries to work with pose with frame id '/map' so it throws an error. I changed my config from '/map' to '//map' and it seems to work.

Julio Aguilar gravatar image Julio Aguilar  ( 2017-04-12 01:24:38 -0500 )edit

I will still paste the launch/config files and sample messages from both inputs when I get the chance. Thanks!

Julio Aguilar gravatar image Julio Aguilar  ( 2017-04-12 01:25:45 -0500 )edit

Can you please post sample input messages? I would like to see one message from /dev/odom and amcl_pose. My first guess is that you need to get rid of the forward slashes at the start of your frame names in the EKF config.

Tom Moore gravatar image Tom Moore  ( 2017-05-04 02:15:30 -0500 )edit

@Tom Moore Sry for the late response

Julio Aguilar gravatar image Julio Aguilar  ( 2017-05-19 05:38:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-08 12:56:00 -0500

Nicholash Bedi gravatar image

You are providing robot localization with two sets of velocities. In the odom configurations, since differential is set to true, x, y and yaw will be differentiated to vx, vy and vyaw, however, you are already sending vx, vy and vyaw. If you either set vx, vy and vyaw to false in your odom configuration or set x, y, yaw and differential to false this should solve your issue.

Let me know if this helps.

edit flag offensive delete link more

Comments

Thanks for the help. Unfortunately, that didn't help. I think the node just ignores any velocities if the differential is set to true and if the corresponding variable (x, y, yaw) is set. But I tried it anyways.

Julio Aguilar gravatar image Julio Aguilar  ( 2017-03-09 02:38:44 -0500 )edit

Question Tools

4 followers

Stats

Asked: 2017-03-08 08:50:39 -0500

Seen: 1,091 times

Last updated: May 19 '17