Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Extend base realsense rs_launch.py file (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyackzan authored Aug 13, 2024
1 parent 7d9d249 commit 9794126
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 40 deletions.
60 changes: 60 additions & 0 deletions src/picknik_ur_base_config/launch/pro_rs_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2024 PickNik Inc.
#
# 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 the PickNik Inc. 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.

import sys

from ament_index_python import get_package_share_directory
from launch import LaunchDescription
from launch.actions import OpaqueFunction

# Add the realsense2_camera/launch directory to the user's path so we can import the realsense2_camera rs_launch module.
realsense2_camera_path = get_package_share_directory("realsense2_camera")
sys.path.append(f"{realsense2_camera_path}/launch")

import rs_launch.configurable_parameters as rs_configurable_parameters


def generate_launch_description():
rs_configurable_parameters.extend(
[
{
"name": "color_qos",
"default": "SENSOR_DATA",
"description": "Color stream QoS settings",
},
{
"name": "depth_qos",
"default": "SENSOR_DATA",
"description": "Depth stream QoS settings",
},
]
)
return LaunchDescription(
rs_launch.declare_configurable_parameters(rs_launch.configurable_parameters)
+ [OpaqueFunction(function=rs_launch.launch_setup)]
)
71 changes: 31 additions & 40 deletions src/picknik_ur_base_config/launch/rs_cameras.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,43 @@
<arg name="wrist_mounted_camera_serial_no" default="'0'" />

<!-- Scene camera -->
<node pkg="realsense2_camera" exec="realsense2_camera_node" name="scene_camera" namespace="scene_camera">
<param name="camera_name" value="scene_camera"/>
<param name="serial_no" value="$(var scene_camera_serial_no)"/>
<param name="device_type" value="D415"/>
<param name="depth_module.profile" value="640x480x6"/>
<param name="rgb_camera.profile" value="640x480x6"/>
<param name="pointcloud.enable" value="True"/>
<param name="pointcloud.ordered_pc" value="True"/>
<param name="decimation_filter.enable" value="False"/>
<include file="$(find-pkg-share picknik_ur_base_config)/launch/pro_rs_launch.py">
<arg name="camera_name" value="scene_camera"/>
<arg name="serial_no" value="$(var scene_camera_serial_no)"/>
<arg name="device_type" value="D415"/>
<arg name="depth_module.profile" value="640x480x6"/>
<arg name="rgb_camera.profile" value="640x480x6"/>
<arg name="pointcloud.enable" value="True"/>
<arg name="pointcloud.ordered_pc" value="True"/>
<arg name="decimation_filter.enable" value="False"/>

<!--# information about the topics the camera publishes the raw image and info-->
<param name="rgb_info" value="/scene_camera/color/camera_info"/>
<param name="rgb_image" value="/scene_camera/color/image_raw"/>
<param name="registered_rgb_depth_pair.depth_info" value="/scene_camera/color/camera_info"/>
<param name="registered_rgb_depth_pair.depth_image" value="/scene_camera/depth/image_rect_raw"/>
<param name="registered_rgb_depth_pair.registered_info" value="/scene_camera/color/camera_info"/>
<param name="registered_rgb_depth_pair.registered_image" value="/scene_camera/depth/image_rect_raw"/>

<!-- QoS settings -->
<param name="color_qos" value="SENSOR_DATA"/>
<param name="depth_qos" value="SENSOR_DATA"/>
</node>
<arg name="rgb_info" value="/scene_camera/color/camera_info"/>
<arg name="rgb_image" value="/scene_camera/color/image_raw"/>
<arg name="registered_rgb_depth_pair.depth_info" value="/scene_camera/color/camera_info"/>
<arg name="registered_rgb_depth_pair.depth_image" value="/scene_camera/depth/image_rect_raw"/>
<arg name="registered_rgb_depth_pair.registered_info" value="/scene_camera/color/camera_info"/>
<arg name="registered_rgb_depth_pair.registered_image" value="/scene_camera/depth/image_rect_raw"/>
</include>

<!-- Wrist camera -->
<node pkg="realsense2_camera" exec="realsense2_camera_node" name="wrist_mounted_camera" namespace="wrist_mounted_camera">
<param name="camera_name" value="wrist_mounted_camera"/>
<param name="serial_no" value="$(var wrist_mounted_camera_serial_no)"/>
<param name="device_type" value="D415"/>
<param name="depth_module.profile" value="640x480x6"/>
<param name="rgb_camera.profile" value="640x480x6"/>
<param name="pointcloud.enable" value="True"/>
<param name="pointcloud.ordered_pc" value="True"/>
<param name="decimation_filter.enable" value="False"/>
<include file="$(find-pkg-share picknik_ur_base_config)/launch/pro_rs_launch.py">
<arg name="camera_name" value="wrist_mounted_camera"/>
<arg name="serial_no" value="$(var wrist_mounted_camera_serial_no)"/>
<arg name="device_type" value="D415"/>
<arg name="depth_module.profile" value="640x480x6"/>
<arg name="pointcloud.enable" value="True"/>
<arg name="pointcloud.ordered_pc" value="True"/>
<arg name="decimation_filter.enable" value="False"/>

<!-- information about the topics the camera publishes the raw image and info -->
<param name="rgb_info" value="/wrist_mounted_camera/color/camera_info"/>
<param name="rgb_image" value="/wrist_mounted_camera/color/image_raw"/>
<arg name="rgb_info" value="/wrist_mounted_camera/color/camera_info"/>
<arg name="rgb_image" value="/wrist_mounted_camera/color/image_raw"/>

<!-- By adding registered_rgb_depth_pair, This camera can be used for "Set Transform From Click" -->
<param name="registered_rgb_depth_pair.depth_info" value="/wrist_mounted_camera/depth/camera_info"/>
<param name="registered_rgb_depth_pair.depth_image" value="/wrist_mounted_camera/depth/image_rect_raw"/>
<param name="registered_rgb_depth_pair.registered_info" value="/wrist_mounted_camera/depth_registered/camera_info"/>
<param name="registered_rgb_depth_pair.registered_image" value="/wrist_mounted_camera/depth_registered/image_rect"/>

<!-- QoS settings -->
<param name="color_qos" value="SENSOR_DATA"/>
<param name="depth_qos" value="SENSOR_DATA"/>
</node>
<arg name="registered_rgb_depth_pair.depth_info" value="/wrist_mounted_camera/depth/camera_info"/>
<arg name="registered_rgb_depth_pair.depth_image" value="/wrist_mounted_camera/depth/image_rect_raw"/>
<arg name="registered_rgb_depth_pair.registered_info" value="/wrist_mounted_camera/depth_registered/camera_info"/>
<arg name="registered_rgb_depth_pair.registered_image" value="/wrist_mounted_camera/depth_registered/image_rect"/>
</include>
</launch>

0 comments on commit 9794126

Please sign in to comment.