You can indeed use ar_track_alvar to detect ar_markers.
If you are using openni_launch or freenect_launch packages to get the images from your kinect, you should have a bunch of topics published.
Camera image topic stands for the topic where your kinect image is published, should look like: /camera/rgb/image_raw
Camera info topic stands for the topic where the information of your camera are published, shoud look like: /camera/rgb/camera_info
The output frame parameter means the link relative to which you want the position of the detected ar marjers will be published (for example base_link) or whatever link suits your application. This must be a link known by tf, otherwise ROS won't be able to compute a transformation.
Documentation can be found here
Examples can be found here
The detected markers will be published on /ar_pose_marker (ar_track_alvar/AlvarMarkers) as an array of AlvarMarkers
You can also visualize them in rviz, you just have to add a marker plugin and select the correspondig topic (/visualization_marker).
Hope this helps,
Originally posted by marguedas with karma: 3606 on 2015-02-16
This answer was ACCEPTED on the original site
Post score: 5
Original comments
Comment by MSYazeed on 2015-02-24:
currently I'm using /camera/rgb/image_color for Camera image topic to make the camera receive the coloured image . and for the output frame I'm using camera_link(not sure its right). but I can't see any output yet and I can't manage to show it on rviz. What am I doing wrong here ?
Comment by MSYazeed on 2015-02-24:
I also should note that I ran roscore first then openni_launch then the ar_track_alvar and rviz. it gives me weird error saying '[1424775599.179064296]: Client [/marker_detect] wants topic /camera/rgb/image_color to have datatype/md5sum [~], but our version has [~]. Dropping connection.
Comment by MSYazeed on 2015-02-24:
This is the full error: [ERROR] [1424775599.179064296]: Client [/marker_detect] wants topic /camera/rgb/image_color to have datatype/md5sum [sensor_msgs/PointCloud2/1158d486dd51d683ce2f1be655c3c181], but our version has [sensor_msgs/Image/060021388200f6f0f447d0fcd9c64743]. Dropping connection.
Comment by marguedas on 2015-02-25:
ok, here the error says that this node requires a sensor_msgs/PointCloud2 and not a color image. So you should use depth_registered (camera/depth_registered/image_raw).
If you want to check the type of a message sent on a given topic you can use: rostopic info TOPICNAME
Comment by MSYazeed on 2015-03-02:
Thank you so much its working now and can detect the the marker, but some how it shows the marker on Rivz for a second then it gives me the following error
Comment by MSYazeed on 2015-03-02:
/usr/include/eigen3/Eigen/src/Core/DenseStorage.h:69: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 16>::plain_array() [with T = float, int Size = 4, int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion is explained here: " "http://e
Comment by marguedas on 2015-03-02:
No idea, Sorry. I've never face this issue. But it seems that several people got this problem recently: http://answers.ros.org/question/203698/error-while-detecting-markers-using-ar_track_alvar/
Try to track these threads and check on the internet, the solution will pop up in the eventually.
Comment by MSYazeed on 2015-03-02:
Thank you so much for your help
Comment by marguedas on 2015-03-02:
"will pop up in the NEXT DAYS eventually": forgot some words in the hurry :s
You're welcome, Happy programming !
Comment by Leandro on 2015-06-10:
Thanks for your help! I coudn't make pr2_indiv.launch work but pr2_indiv_no_kinect.launch is running normally thanks to you.