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

Add corrections (AR tags) to EKF

asked 2019-05-06 04:37:59 -0500

Dylan gravatar image

updated 2019-05-21 10:34:04 -0500

I'm using the EKF of the robot_localization package. The inputs of the EKF would be just the IMU or maybe the IMU and an odometry (using a visual odometry package, but I couldn't make it work well, so maybe I don't use it).

But, when a predefined AR tag is in the FOV of my quadcopter, using the ar_track_alvar package I have the relative position and orientation of my quadcopter (i.e, the position and orientation in the tag frame).

I need to add the information provided by the tag detector, when it exists. And, when it exists, that information is discrete.

I don't know how to do that but I think that what I have to do is to store the relative pose (position+orientation) in a specific topic. When there's information, I store that information. When there's no information, I store an error message so I know that I don't need to use that information. Is that correct?

But now, how can I add that information to the robot_localization package? It would be something similar to the GPS data, but the package only talks about the GPS data, not data provided by a tag detector, for example.

I hope someone can help me. I really need to make this work. Thanks!


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-05-15 04:38:37 -0500

Tom Moore gravatar image

I need to add the information provided by the tag detector, when it exists. And, when it exists, that information is discrete.

I assume by this that you mean that you would like to fuse the AR tag data into your EKF state estimate.

Your tag data, as you said, is likely the pose of your robot with respect to the tag. What you need to do is provide a transform from your world frame origin to the tag in question. So when the robot sees the tag, it transform that tag to your EKF world frame, and then fuses it. But that means that you need to provide a separate transform for each tag in your environment.

edit flag offensive delete link more


I'm trying to transform the information from the camera (it's the distance between the tag and the quadcopter (relative to the tag)) to the odom frame. Can you please help me to do that? Maybe telling me from where I can read how to do that

Dylan gravatar image Dylan  ( 2019-05-18 09:43:36 -0500 )edit

You need to define, for each tag, its pose in your world (e.g., odom) frame. So decide on an origin point for your space, and then determine where your tag is in that coordinate frame. Then make a static transform publisher from odom->your_tag_id with that pose. If the AR messages have the right frame_id (in this case, your_tag_id), the EKF will transform them to the odom frame, and fuse them.

Tom Moore gravatar image Tom Moore  ( 2019-05-21 03:03:52 -0500 )edit

And what if the tag moves?

Dylan gravatar image Dylan  ( 2019-05-21 06:13:46 -0500 )edit

Then you need to update the transform. The tags will need to be grounded in some global coordinate frame. Otherwise, what you're trying to do wouldn't make any sense.

Tom Moore gravatar image Tom Moore  ( 2019-05-21 07:12:23 -0500 )edit

How can I transform the pose in the tag frame to the odom frame, for example? Is there any tutorial where that is explained? What I would do is to put the relative position of the tag to the camera in a predefined topic, then add the diatancw from the base link to the camera and then to the odom, using a python script. But it should be a better way

Dylan gravatar image Dylan  ( 2019-05-21 08:16:45 -0500 )edit

@TomMoore I posted the view_frames so you can see what I need: convert ar_marker_20 to odom frame

Dylan gravatar image Dylan  ( 2019-05-21 10:34:47 -0500 )edit

So forget the EKF for a moment. You have a set of AR tags. Pick an origin for your space, and mark it down with tape or something (position and orientation - actually make axes). Now go put down an AR tag. Measure - using whatever means you want - the pose of that tag with respect to the origin. Put it in some kind of data store. When you run your robot, you need to:

  • Put the robot at the origin point when you start it (or point it at a tag that's in the data store)
  • Have some kind of node that reads from your data store and publishes an odom->that_tag_id transform for every AR tag that's in the data store.

Then, when the EKF sees that tag, it will be able to transform it to the odom frame.

If you don't like the manual approach ...(more)

Tom Moore gravatar image Tom Moore  ( 2019-06-06 02:40:57 -0500 )edit

I tried whatever was suggested by @Tom Moore but i am getting redundant tf error, because of 1. odom -> marker id static tf and 2. ar_alvar_tag publishing detected marker id(same marker id) on the robot's tf.

Yash Sahu gravatar image Yash Sahu  ( 2022-08-03 00:47:08 -0500 )edit

Question Tools



Asked: 2019-05-06 04:37:59 -0500

Seen: 408 times

Last updated: May 21 '19