April tag 2 ROS pose detection
Hi,
I am using the Apriltag2_ros package to detect the apriltags in my scene.
Everything works well and I get really good pose detections. The problem is that its too slow, I have a lag when I view it on rviz.
I checked the origin source code Apriltag too and that seems to run with a lag too.
I didn't know where to ask this question so started here.
Thanks in advance for the help.
My Launch file (continuous_detection.launch)
<launch>
<arg name="launch_prefix" default="" />
<arg name="node_namespace" default="apriltags2_ros_continuous_node" />
<arg name="camera_name" default="camera" />
<arg name="camera_frame" default="camera" />
<arg name="image_topic" default="image_rect_color" />
<!-- Set parameters -->
<rosparam command="load" file="$(find apriltags2_ros)/config/settings.yaml" ns="$(arg node_namespace)" />
<rosparam command="load" file="$(find apriltags2_ros)/config/tags.yaml" ns="$(arg node_namespace)" />
<node pkg="apriltags2_ros" type="apriltags2_ros_continuous_node" name="$(arg node_namespace)" clear_params="true" output="screen" launch-prefix="$(arg launch_prefix)" >
<remap from="image_rect" to="$(arg camera_name)/$(arg image_topic)" />
<remap from="camera_info" to="$(arg camera_name)/camera_info" />
<param name="camera_frame" type="str" value="$(arg camera_frame)" />
<param name="publish_tag_detections_image" type="bool" value="true" />
</node>
</launch>
Tag Setting:
standalone_tags:
[
{id: 0, size: 0.17, name: YOLO}
]
What is you actual question?
That the time taken for the algorithm to process one image is extremely high. This makes the pose detection really slow. Do you have the same problem or is it only me?
What is your hardware setup? You said "I have a lag when I view it on rviz." - does this mean it only lags when you try and visualize in rviz?
Intel Xeon Processor with 4 cores and 32gb RAM. "does this mean it only lags when you try and visualize in rviz". Its lags while detecting too, the overall algorthim speed is slow is what I meant.
What resolution images are you feeding into it? This sounds unusually slow given your hardware. We've have this running at 30fps on smaller machines.
The resolution is 2048 x 2048.
Okay that's big but certainly not too big. Can you try using the rqt_top gui to check how much CPU your nodes are using just to confirm that the Apriltag2 node is the problem.
Its using a lot of CPU around 200%