Skip to content

Commit

Permalink
Add OAKD
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Oct 3, 2024
1 parent f0c2af2 commit a702519
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
25 changes: 25 additions & 0 deletions clearpath_sensors/config/luxonis_oakd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
oakd:
ros__parameters:
camera:
i_enable_imu: false
i_enable_ir: false
i_floodlight_brightness: 0
i_laser_dot_brightness: 100
i_nn_type: none
i_pipeline_type: RGB
i_usb_speed: SUPER_PLUS
i_usb_port_id: ''
rgb:
i_board_socket_id: 0
i_fps: 30.0
i_height: 720
i_interleaved: false
i_max_q_size: 10
i_preview_size: 250
i_enable_preview: true
i_low_bandwidth: true
i_keep_preview_aspect_ratio: true
i_publish_topic: false
i_resolution: '1080P'
i_width: 1280
use_sim_time: false
105 changes: 105 additions & 0 deletions clearpath_sensors/launch/luxonis_oakd.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Software License Agreement (BSD)
#
# @author Luis Camero <[email protected]>
# @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution

from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
parameters = LaunchConfiguration('parameters')
namespace = LaunchConfiguration('namespace')
robot_namespace = LaunchConfiguration('robot_namespace')

arg_parameters = DeclareLaunchArgument(
'parameters',
default_value=PathJoinSubstitution([
FindPackageShare('clearpath_sensors'),
'config',
'intel_realsense.yaml'
]))

arg_namespace = DeclareLaunchArgument(
'namespace',
default_value='')

arg_robot_namespace = DeclareLaunchArgument(
'robot_namespace',
default_value='')

depthai_oakd_node = ComposableNode(
package='depthai_ros_driver',
name='oakd',
namespace=namespace,
plugin='depthai_ros_driver::Camera',
parameters=[parameters],
remappings=[
('~/imu/data', 'imu/data'),
('~/nn/spatial_detections', 'nn/spatial_detections'),
('~/rgb/camera_info', 'color/camera_info'),
('~/rgb/image_raw', 'color/image'),
('~/rgb/image_raw/compressed', 'color/compressed'),
('~/rgb/image_raw/compressedDepth', 'color/compressedDepth'),
('~/rgb/image_raw/ffmpeg', 'color/ffmpeg'),
('~/rgb/image_raw/theora', 'color/theora'),
('~/rgb/preview/image_raw', 'color/image'),
('~/rgb/preview/image_raw/compressed', 'color/compressed'),
('~/rgb/preview/image_raw/compressedDepth', 'color/compressedDepth'),
('~/rgb/preview/image_raw/ffmpeg', 'color/ffmpeg'),
('~/rgb/preview/image_raw/theora', 'color/theora'),
('~/stereo/camera_info', 'stereo/camera_info'),
('~/stereo/image_raw', 'stereo/image'),
('~/stereo/image_raw/compressed', 'stereo/compressed'),
('~/stereo/image_raw/compressedDepth', 'stereo/compressedDepth'),
('~/stereo/image_raw/ffmpeg', 'stereo/ffmpeg'),
('~/stereo/image_raw/theora', 'stereo/theora'),
('/diagnostics', 'diagnostics'),
],
extra_arguments=[{'use_intra_process_comms': True}],
)

image_processing_container = ComposableNodeContainer(
name='image_processing_container',
namespace=namespace,
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
depthai_oakd_node
],
output='screen'
)

ld = LaunchDescription()
ld.add_action(arg_parameters)
ld.add_action(arg_namespace)
ld.add_action(arg_robot_namespace)
ld.add_action(image_processing_container)
return ld
1 change: 1 addition & 0 deletions clearpath_sensors/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>depthai_ros_driver</exec_depend>
<exec_depend>flir_camera_description</exec_depend>
<exec_depend>flir_camera_msgs</exec_depend>
<exec_depend>image_proc</exec_depend>
Expand Down

0 comments on commit a702519

Please sign in to comment.