Add corrections (AR tags) to EKF
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 artrackalvar 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!
Asked by Dylan on 2019-05-06 04:37:59 UTC
Answers
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.
Asked by Tom Moore on 2019-05-15 04:38:37 UTC
Comments
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
Asked by Dylan on 2019-05-18 09:43:36 UTC
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.
Asked by Tom Moore on 2019-05-21 03:03:52 UTC
And what if the tag moves?
Asked by Dylan on 2019-05-21 06:13:46 UTC
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.
Asked by Tom Moore on 2019-05-21 07:12:23 UTC
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
Asked by Dylan on 2019-05-21 08:16:45 UTC
@TomMoore I posted the view_frames so you can see what I need: convert ar_marker_20 to odom frame
Asked by Dylan on 2019-05-21 10:34:47 UTC
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, you try combining it with mapping: use SLAM, and every time you see a pose, mark down the global coordinates of those tags into the same data store.
Asked by Tom Moore on 2019-06-06 02:40:57 UTC
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.
Asked by Yash Sahu on 2022-08-03 00:47:08 UTC
In that case I would suggest you do the transformations manually, like publish a different name for that corresponding frame, and used a node to do the calculations. Or (I'm not 100% sure), publish that static frame you want with a different name maybe ar_tag_id instead of marker_id if the EKF uses a pose as an input sensor you haven't shared your configuration tho, you may use a simpler node extracting pose data of that ar tag, and change it's frame_id in the header to the new name and publish that pose and have EKF subscribe to that new topic that should do the trick.
Asked by asser19 on 2022-09-06 10:46:50 UTC
Comments