Ask Your Question
0

Random position in AMCL with robot_localization

asked 2018-10-04 11:11:04 -0500

Mahmoud Kamel gravatar image

updated 2018-10-05 08:09:09 -0500

Hello,

I have a problem in using AMCL package , The output position is totally random. When feeding the /initial_pose topic with current output of robot localization , the car is on the right position on the map. As shown in the next pic: image description

As soon as the car moves , Particles start to vastly spread out and randomly jump and the car never localize itself in a proper way again as shown in the video: amcl

I didn't investigate much at amcl parameters . But I suspect that I have a fundamental issue. Am I missing something? Here is my setup:

robot localization ( 1 local node): inputs: imu , wheel_odometry ( I put odometry child_frame_id as base_footprint and imu as i mu_link "fixed transfor to base_footprint" )

Sample Msgs:

IMU:

header: 
  seq: 25
  stamp: 
    secs: 1538665174
    nsecs: 779748916
  frame_id: "imu_link"
orientation: 
  x: -0.021728795831
  y: 0.0629217740198
  z: 0.934970575289
  w: 0.348423209804
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01]
angular_velocity: 
  x: 0.0010685628315
  y: 0.00427425132599
  z: 0.00747993982048
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration: 
  x: 1.45088620605
  y: 1.59932670898
  z: 10.4099888184
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Wheel_Odom:

header: 
  seq: 1
  stamp: 
    secs: 1538665300
    nsecs: 997972965
  frame_id: "odom"
child_frame_id: "base_footprint"
pose: 
  pose: 
    position: 
      x: 0.0
      y: 0.0
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 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]
twist: 
  twist: 
    linear: 
      x: 0.0
      y: 0.0
      z: 0.0
    angular: 
      x: 9.0
      y: 0.0
      z: 0.0
  covariance: [1e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-06, 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.01]

Launch File:

<launch>  
    <node pkg="robot_localization" type="ekf_localization_node" name="ekf_loc" clear_params="true" output="screen">      
      <remap from="odometry/filtered" to="/odometry/filtered1" />
      <param name="frequency" value="5"/>
      <param name="sensor_timeout" value="0.3"/>
      <param name="map_frame" value="map"/>
      <param name="two_d_mode" value="true"/>
      <param name="odom_frame" value="odom"/>
      <param name="base_link_frame" value="base_footprint"/>
      <param name="world_frame" value="odom"/>
     <param name="use_control"       value="false"/>
      <param name="odom0" value="/rdwheel_odometry_new"/>
      <param name="imu0" value ...
(more)
edit retag flag offensive close merge delete

Comments

You should have the wheels in your tf tree. Also you can see that the buffer length between map and odom is 0.0 which means no data is sent. Can you tell us which robot you are using ?

Delb gravatar image Delb  ( 2018-10-05 02:13:09 -0500 )edit

Also I'd recommend two things :

  • Check if the odom output when moving straight forward is correct.
  • Try running your project without the ekf_localization_node and see what happen
Delb gravatar image Delb  ( 2018-10-05 02:19:26 -0500 )edit

My robot is an ackerman golf cart. I use wheel odometry twist messege in base_footprint frame which is in the middle of the 2 rear wheels. I didn't notice the buffer lenght . I think that's why there is insane output position. But why amcl node (the publisher of this tf) did that?

Mahmoud Kamel gravatar image Mahmoud Kamel  ( 2018-10-05 07:25:52 -0500 )edit

If I didn't use robot localization . I think I have to publish a transform (base_footprint -> odom ) myself. I already tried that . I published this transform using imu and wheel_odometry data . And The same thing happened.

Mahmoud Kamel gravatar image Mahmoud Kamel  ( 2018-10-05 07:28:26 -0500 )edit

I've looked the urdf of the ackerman golf cart and you should definitly have a bigger tf_tree. You don't even have the tf base_link->base_footprint. Can you load correctly your urdf in rviz ? (if yes can you show us the tf_tree only when visualizing the robot and using nothing else please ?)

Delb gravatar image Delb  ( 2018-10-05 07:47:30 -0500 )edit

Thank you for your time. Please check the question. I updated it.

Mahmoud Kamel gravatar image Mahmoud Kamel  ( 2018-10-05 08:06:12 -0500 )edit

Using two_d_mode only specify if you are operating in a planar envirronment to facilitate the calculations so it's not related to tf. Does using the full urdf create errors ? Also have you checked that odom has coherent values when moving straight forward ?

Delb gravatar image Delb  ( 2018-10-05 08:42:38 -0500 )edit

No , using the full urdf doesn't create errors. I 'll revise odom values again to check that , and I'll return with a bag file. Until that what do you suspect? Is there something wrong in robot localization configuration that may outputs coherent values ?

Mahmoud Kamel gravatar image Mahmoud Kamel  ( 2018-10-05 08:49:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-10-22 12:34:39 -0500

Mahmoud Kamel gravatar image

My problem was laserScan frequency . My lidar frequency is too low (0.8 Hz) .

I used this low frequency in simulation and it generated the same problem.

When I reduced car speed to a very low speed with the same lidar frequency , Things worked.

edit flag offensive delete link more

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: 2018-10-04 11:11:04 -0500

Seen: 629 times

Last updated: Oct 22 '18