luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
255 stars 186 forks source link

[Question] How to Configure OakD Camera in ROS environment #281

Closed cwillboyd closed 1 year ago

cwillboyd commented 1 year ago

I am trying to understand how I can configure my OakD W PoE camera within a ROS environment. I have installed the depthai_ros package as a git submodule in my ROS repo. I am primarily interested in the stereo camera mode and I am able to launch the "stereo_inertial_node" and the "stereo_node" in my own launch file as follows.

<node name="$(arg namespace)" pkg="depthai_examples" type="stereo_inertial_node" output="screen" required="true" if="$(eval arg('use_wide') == 'oakd')">
    <param name="resourceBaseFolder" value="$(find depthai_examples)/resources"/>
    <param name="monoResolution" value="$(arg resolution)"/>
    <rosparam command="load" file="$(find burro_launcher)/params/drivers/oakd_stereo.yaml"/>
  </node>

  <node name="$(arg namespace)" pkg="depthai_examples" type="stereo_node" output="screen" required="true" if="$(eval arg('use_wide') == 'oakd_wide')">
    <param name="resourceBaseFolder" value="$(find depthai_examples)/resources"/>
    <param name="camera_param_uri" value="$(arg camera_param_uri)"/>
    <param name="monoResolution" value="$(arg resolution)"/>
    <rosparam command="load" file="$(find burro_launcher)/params/drivers/oakd_stereo.yaml"/>
  </node>

I need to gain access to all of the camera control settings and configure the stereo depth node within ROS. What are the possible ways to accomplish this?

  1. If I am able to run the default depthai_ros_driver/Camera will I be able to change all camera settings using ROS parameters and dynamic reconfigure ? I noticed that some of the expsoure controls were available when using camera.launch and rqt (exposure time, ISO, enable/disable AE,etc.) but some were not available (setAutoExposureCompensation, setAutoExposureRegion, etc.)

  2. Would it be better to create my own driver ... perhaps using the stereo_node or stereo_intertial_node as a starting point to be able to configure all camera settings?

Serafadam commented 1 year ago

Hi, regarding parameter updates, you would need to add some external callbacks that process & update those parameters. These methods are available in depthai_ros_driver, although not all of them available as of now. For parameter list in noetic you can check this file, and for updates, this one. You would need to edit those two files to add more options.

Serafadam commented 1 year ago

Closing due to inactivity, please reopen if there are still questions.