AprilRobotics / apriltag_ros

A ROS wrapper of the AprilTag 3 visual fiducial detector
Other
366 stars 340 forks source link

CPU usage of apriltag_ros #112

Closed kaganerunsal closed 1 year ago

kaganerunsal commented 2 years ago

Hello,

I am using apriltag_ros package to detect the relative pose between my robots. I have a fix tag size (10cm), max detection distance (3.5m) and operating frequency (20 Hz). While keeping them constant, I am trying to reduce the CPU usage since my onboard resources are limited. I am using Jetson Xavier NX as an onboard computer.

So far I have the following observations:

  1. Reducing "native camera resolution" reduces the CPU usage but also reduces the max. distance tags are detected. So I have min. resolution in order to detect the tags at 3.5m.
  2. Reducing "native camera frequency" reduces CPU usage.
  3. Reducing "tag decimation" has similar effect as (1).

I have the following questions:

  1. Are some tags are more easy to detect than others, considering max. detectable distance, e.g. 16h5 ?
  2. If I disable some topics like "Tag Detections", does it reduce the CPU usage?
  3. I need to detect at most 2 tags simultaneously, is there a parameter to limit this in order to reduce CPU usage?
  4. Does "tag_threads" parameter work? Even if I set them to 2, the nodelets always start with max number of threads
  5. Are there other ways to reduce the CPU usage while satisfying my requirements.

Thank you for your help in advance.

Best, Kagan

wxmerkt commented 1 year ago

Hi Kagan, since you are using a Jetson, there is a GPU-optimised version of AprilTags released by Nvidia: https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_apriltag