luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
239 stars 174 forks source link

Add publisher_name to enable multiple YOLO cameras #291

Closed roboav8r closed 1 year ago

roboav8r commented 1 year ago

Trying to launch multiple OAK-D devices with yolov4_publisher.launch results in the following errors, which shut down any additional nodes:

[ WARN] [1682021846.705231965]: Shutdown request received.
[ WARN] [1682021846.706189721]: Reason given for shutdown: [[/oak_state_publisher] Reason: new node registered with same name]
[ WARN] [1682021846.871090300]: Shutdown request received.
[ WARN] [1682021846.871929326]: Reason given for shutdown: [[/yolov4_publisher] Reason: new node registered with same name]

Additional oak_state_publisher instances can be launched by adjusting camera_model, tf_prefix, or base_frame arguments when launching yolov4_publisher.launch, but there are no arguments to enable multiple yolov4_spatial_node instances. This edit allows a node name to be specified as an argument, preventing the shutdown request and enabling multiple OAK-Ds to be launched with yolov4_publisher.launch.