0
$\begingroup$

Rosanswers logo

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!


Originally posted by zzzzzq on ROS Answers with karma: 18 on 2018-03-26

Post score: 0


Original comments

Comment by ahendrix on 2018-03-26:
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.

Comment by ahendrix on 2018-03-26:
Also of interest, how big are the images that you're trying to process?

Comment by zzzzzq on 2018-03-26:
The image is raw image from the camera. I use ASUS xtion and the image topic is /camera/rgb/image_raw

Comment by zzzzzq on 2018-03-26:
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

Comment by ahendrix on 2018-03-27:
Well, that seems to rule out the CPU as a bottleneck. Have you tried checking the rate of the image topic? Try rostopic hz

Comment by gvdhoorn on 2018-03-28:
Why did you delete your previous edit?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I have fixed that error. The problem is the code, there is a ros::Duration(5.0) in my code. But when I checked the original code it is right. Maybe I changed the code carelessly.


Originally posted by zzzzzq with karma: 18 on 2018-03-31

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.