0
$\begingroup$

Rosanswers logo

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.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.008812990937814283]

Thanks and kind regards, Julio


Originally posted by Julio Aguilar on ROS Answers with karma: 56 on 2017-03-08

Post score: 1


Original comments

Comment by Nicholash Bedi on 2017-03-08:
What are your pose/odom config, differential, and relative set to?

Comment by Tom Moore on 2017-04-11:
Can you paste (a) your full launch/config files, and (b) sample messages from every input? Thanks!

Comment by Tom Moore on 2017-04-11:
(Just a heads-up: you have two sources of pose data measuring X and Y, and they are not going to agree).

Comment by Julio Aguilar on 2017-04-12:
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.

Comment by Julio Aguilar on 2017-04-12:
I will still paste the launch/config files and sample messages from both inputs when I get the chance. Thanks!

Comment by Tom Moore on 2017-05-04:
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.

Comment by Julio Aguilar on 2017-05-19:
@Tom Moore Sry for the late response

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Nicholash Bedi with karma: 68 on 2017-03-08

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Julio Aguilar on 2017-03-09:
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.

$\endgroup$

Your Answer

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