Closed MAVProxyUser closed 1 year ago
Hi, thanks a lot!, minor comment, I'd change it to use the same launch file as current yolo launch, and just add argument to choose if we want spatial version or not.
Cool @Serafadam it was a stretch for me to get this sorted out. I may need to rely on you for that last mile. I'm not super familiar with launch file semantics.
@Serafadam in your opinion what would be the best way to handle the small differences? If camera_model is OAK-1 then launch the other node? That seem reasonable?
ubuntu@ubuntu:~/depthai-ros$ diff depthai_examples/launch/yolov4_publisher_nodepth.launch.py depthai_examples/launch/yolov4_publisher.launch.py
22c22
< camera_model = LaunchConfiguration('camera_model', default = 'OAK-1-MAX')
---
> camera_model = LaunchConfiguration('camera_model', default = 'OAK-D')
35a36
> subpixel = LaunchConfiguration('subpixel', default = True)
38a40,41
> lrCheckTresh = LaunchConfiguration('lrCheckTresh', default = 5)
> monoResolution = LaunchConfiguration('monoResolution', default = '400p')
43c46
< description='The model of the camera. Using a wrong camera model can disable camera features. Valid models: `OAK-1, OAK-1-MAX`.')
---
> description='The model of the camera. Using a wrong camera model can disable camera features. Valid models: `OAK-D, OAK-D-LITE`.')
99a103,107
> declare_subpixel_cmd = DeclareLaunchArgument(
> 'subpixel',
> default_value=subpixel,
> description='Enables subpixel stereo detection.')
>
114a123,132
> declare_lrCheckTresh_cmd = DeclareLaunchArgument(
> 'lrCheckTresh',
> default_value=lrCheckTresh,
> description='LR Threshold is the threshod of how much off the disparity on the l->r and r->l ')
>
> declare_monoResolution_cmd = DeclareLaunchArgument(
> 'monoResolution',
> default_value=monoResolution,
> description='Contains the resolution of the Mono Cameras. Available resolutions are 800p, 720p & 400p for OAK-D & 480p for OAK-D-Lite.')
>
129,130c147,148
< yolov4_image_node = launch_ros.actions.Node(
< package='depthai_examples', executable='yolov4_image_node',
---
> yolov4_spatial_node = launch_ros.actions.Node(
> package='depthai_examples', executable='yolov4_spatial_node',
136c154,155
< {'resourceBaseFolder': resourceBaseFolder}])
---
> {'resourceBaseFolder': resourceBaseFolder},
> {'monoResolution': monoResolution}])
157a177
> ld.add_action(declare_subpixel_cmd)
160a181,182
> ld.add_action(declare_lrCheckTresh_cmd)
> ld.add_action(declare_monoResolution_cmd)
162c184
< ld.add_action(yolov4_image_node)
---
> ld.add_action(yolov4_spatial_node)
Instead of device check, I'd add a spatial
flag that launches given node, in cpp we can probe device how much sensors it has and return error if it only has one sensor (that's basically how it works now in depthai_ros_driver)
Ok @Serafadam I did my best! Sadly I had to move off my humble install for compatibility with other devices. I'm on noetic for the time being. Perhaps you can see if I got it right!?
LGTM, could you change target branche to humble
?
LGTM, could you change target branche to
humble
?
I think I tried to... but now it says "This branch has conflicts that must be resolved". Do you know how to handle that?
@Serafadam do you need me to rebase, or do something else with this?
Hi @MAVProxyUser, sorry for the delay, it seems that you either need to pull changes from humble
branch and resolve confilcts. You could also try creating a new branch from humble and apply those changes here, that's probably a simpler way. I can also do that after my current backlog clears up a little bit.
This look any better @Serafadam ?
Tested successfully with OAK-1-MAX, OAK-D-S2, OAK-D-PRO. Original OpenCV AI Kit: Oak-1 version failed with following error:
This is likely due to "Device type:" being reported as blank https://github.com/luxonis/depthai-ros/issues/257#issuecomment-1480627256
To test with other cams launch with:
Query YOLO hits with: