How to read markers in ar_track_alvar?
Hi there,
I was trying to use this pkg ar_track_alvar to detect a tag, and I found out that it keeps recognizing random things as tags. So I want to filter those wrong targets out by using the code that the marker contains, but I couldn't find anything related to the ID/number in any rostopic, does this mean the node isn't decoding the marker?
Does anyone have any idea about it?
Thank you in advance!
Best Regards
Updates
- if I add code on, the tag looks like this in simulation
- about false positive: when the camera is heading to a wall with 3 gray patches(without any code on them)
- and this is what the topic /ARmarker_points shows
Can you show us your code and images of the tags that you're using. I've given you enough karma to do this now. ar_track_alvar is definitely capable identifying specific markers and I've never seen it detect a false positive. We'll need to know some more information about how you're using it before we can help you though.
@PeteBlackerThe3rd Hi! Thank you for replying, and I'm using this pkg in a simulation, the robot is running in gazebo. I just launched ar_track_alvar with a launch file, nothing special. And the pix are above, please let me know if you need some more information.
And one problem solved: the marker is actually being decoded and published to rostopic "/ar_pose_marker" as member "id" in rosmsg type "ar_track_alvar_msgs/AlvarMarkers"! But I wrongly chose "gray color" as the background of tag code, that's why I kept receiving random numbers as "id". The problem of false positive remains though.
The bright white color of your walls is probably causing most of your problems. ar_track_alvar thresholds the camera image into a binary image before trying to detect the markers. So unless the white areas of the markers are close to the brightest areas in the image this won't work very well.
Try changing the walls to a darker tone or color and see if that helps.
Yes, that's the problem there, I fixed this by applying exact white color in markers, and all those false positives could be filtered out by using 'id's of markers. Thx Pete!
Great, glad you got it working. If you could accept my answer below, then other users will be able to see that your question has a solution. Thanks.