JMU-ROBOTICS-VIVA / ros2_aruco

ROS2 Wrapper for OpenCV Aruco Marker Tracking
MIT License
65 stars 67 forks source link

How to track multiple markers? #11

Open SlavenLeskovar opened 4 months ago

SlavenLeskovar commented 4 months ago

Hi, I have been trying to track 2 different markers at the same time with my drone camera. Im using this yaml file for launching but when the node starts, it only uses the last values, in this example values for DICT_6X6_1000 and neglects the first one. Is there a proper way to use these 2 types of markers at the same time?

/aruco_node:
  ros__parameters:
    marker_size: 0.132
    aruco_dictionary_id: DICT_7X7_1000
    image_topic: /image_raw
    camera_info_topic: /camera_info
/aruco_node:
  ros__parameters:
    marker_size: 0.132  
    aruco_dictionary_id: DICT_6X6_1000  
    image_topic: /image_raw  
    camera_info_topic: /camera_info  
jkaniuka commented 4 months ago

Hi @SlavenLeskovar, in YAML file you pasted you defined parameters for the same node two times, so when this file is being parsed the second set of params overrides the first one. If you want to use two ArUco dictionaries at the same time, you have to launch aruco_node two times under different namespaces and with different YAML config files. If you need further assistance, I can provide you with a launch file with proper configuration :wink:

SlavenLeskovar commented 4 months ago

Hi @SlavenLeskovar, in YAML file you pasted you defined parameters for the same node two times, so when this file is being parsed the second set of params overrides the first one. If you want to use two ArUco dictionaries at the same time, you have to launch aruco_node two times under different namespaces and with different YAML config files. If you need further assistance, I can provide you with a launch file with proper configuration 😉

Hello, yes it is correct. I have added another aruco_node in my launch file that uses different YAML file and remapped the topic to /aruco_poses2. Thanks!