Ask Your Question
0

How to make robot_localization work with AR tags

asked 2018-03-01 05:06:01 -0600

simff gravatar image

updated 2018-03-02 02:44:45 -0600

Hi,

We are working on a project and we have big issues using robot_localization to work as a global localizer. We are using ROS Kinetic, Gazebo 7.0, a Kinect camera and ekf_localization_node as filter node. The final goal is get out from the filter absolute robot positions by fusing odometry sensor data and AR codes distance information coming from ar_track_alvar.

No matter how we feed the filter with marker's data, the map frame just heavily jumps, and as consequence the final robot's pose is erroneous. When no tags are detected, so only feeding Ekf with the odometry, the map frame stays in place, as seen here:

The ekf.param file is seen below:

frequency: 40
sensor_timeout: 1
two_d_mode: true
#transform_time_offset: 0.0
#print_diagnostics: true
debug: false
publish_tf: true
publish_acceleration: false
map_frame: map              # Defaults to "map" if unspecified
odom_frame: odom            # Defaults to "odom" if unspecified
base_link_frame: base_link  # Defaults to "base_link" if unspecified
world_frame: map          # Defaults to the value of odom_frame if unspecified

dynamic_process_noise_covariance: true

odom0: od
odom0_config: [true,  true,  false,
               false, false, true,
               false, false, false,
              false, false, false,
               false, false, false]
odom0_differential: true
odom0_relative: false
odom0_queue_size: 40
odom0_nodelay: false

odom1: marker1
odom1_config: [true,  true,  false,
              false, false, true,
               false, false, false,
              false, false, false,
               false, false, false]
odom1_differential: false
odom1_relative: false
odom1_queue_size: 40
odom1_nodelay: false

process_noise_covariance: [0.0001, 0,    0,    0,    0,    0, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0.0001, 0,    0,    0,    0, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0.0001, 0,    0,    0, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0.0001, 0,    0, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0.0001, 0, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0.0001, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0.0001, 0,     0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0.0001, 0,    0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0.0001, 0,    0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0,    0.0001, 0,    0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0,    0,    0.0001, 0,    0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0,    0,    0,    0.0001, 0,    0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0,    0,    0,    0,    0.0001, 0,    0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0,    0,    0,    0,    0,    0.0001, 0,
                           0,    0,    0,    0,    0,    0, 0,     0,     0,    0,    0,    0,    0,    0,    0.0001]


initial_estimate_covariance: [1, 0,    0,    0,    0,    0, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    1, 0,    0,    0,    0, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                              0,    0,    1e-9, 0,    0,    0, 0,    0,    0,    0 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you post an example of the output from your marker1 topic? It sounds like that is where the problem is.

stevejp gravatar imagestevejp ( 2018-03-05 08:43:12 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-03-12 02:27:55 -0600

simff gravatar image

Solved

Thanks for the reply Mr. Moore, the issue was indeed a missing reference of the fiducial markers to our world position. Thanks to your suggestion now it works! We simply add static transforms marker --> world_marker and then lookup the tf between world_marker and base_link. Finally we gave to the Ekf as input the corresponding message for that transform, by using as a message frame_id the map and that was it. The final output is now the base_link position seen from the map frame.

Cheers

edit flag offensive delete link more

Comments

Glad it worked out.

Tom Moore gravatar imageTom Moore ( 2018-03-19 04:46:53 -0600 )edit
2

answered 2018-03-08 09:57:13 -0600

Tom Moore gravatar image

Please post a sample input message from every input.

You are trying to fuse a sensor-relative pose as an absolute pose. I'm not entirely familiar with ar_track_alvar, but in order to fuse a pose from a fiducial marker, you need to know the world-frame pose of that fiducial marker. For example, suppose you start your robot, and it can't see any markers. You drive around for a while, and you get to some pose, e.g., (10, 4) and with a yaw of 0.29 (I'm assuming a 2D use case). Now you see a fiducial marker. Your tracking package, presumably, produces a pose estimate relative to the camera, but that's not grounded in anything. In order for that to update your robot's pose, you need it to produce a world-frame pose estimate. In this case, there would have to be some world-frame pose associated with every single fiducial. Then, when your robot sees it at some relative pose, you'd apply that relative pose (inverse) to the fiducial world-frame pose, and you'd have the pose of your camera in the world frame. You'd have to apply the camera->base_link transform to get the pose of your robot.

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

3 followers

Stats

Asked: 2018-03-01 05:06:01 -0600

Seen: 919 times

Last updated: Mar 12 '18