ar_track_alvar publication rate too small
Hello! These days I'm trying to use ar_track_alvar to track ar tags but the publication of ar_track_poses is too slow.
I use Ubuntu 16.04 and ros kinetic. My CPU is Intel I7 with 8G memory. When I use ar_track_alvar, it onlypublish /ar_pose_markers at poorly 0.2hz.
I also found that the problem is the rate at which the callback function is called. That function is called merely once every 5 secs. But I can't find anything wrong. I also checked the while(ros::ok())
loop, it tooks 5 secs per loop. However, every step in that loop is very quick. It shouldn't take that long to run each loop. I also checked that the expected rate per loop is 8 hz but actual rate is 0.2 hz. I did this by checking rate.expectedCycleTime() and rate.cycleTime().
Here is the code and the while
loop is at line 326.
I have also tested it on Ubuntu 14.04 and ros indigo, the publication rate is 1hz. However my friend can use it with a publication rate of 8 hz on Ubuntu 14.04 and indigo. That's very odd.
Thanks!
I would check the publication of your image topic and the CPU usage of the ar_track_alvar node to get a sense for whether the slowness is combing from the input, CPU usage or something else within the code.
Also of interest, how big are the images that you're trying to process?
The image is raw image from the camera. I use ASUS xtion and the image topic is /camera/rgb/image_raw
I checked the CPU usage, it seems that the usage of ar_track_alvar node is always around 2%, regardless of whether I turn off other CPU consuming process or not. What's more, how can I check the image size? I use the rgb image from kinect and I assume it is 640*480
Well, that seems to rule out the CPU as a bottleneck. Have you tried checking the rate of the image topic? Try
rostopic hz
Why did you delete your previous edit?