Skip to content

Commit

Permalink
Generate remappings
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-camero committed Jul 8, 2024
1 parent aeb5d7c commit 40a2ef3
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 26 deletions.
64 changes: 64 additions & 0 deletions clearpath_sensors/config/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
intel_realsense:
ros__parameters:
camera_name: camera
camera_namespace: camera
serial_no: ''
usb_port_id: ''
device_type: ''
config_file: ''
json_file_path: ''
initial_reset: false
accelerate_gpu_with_glsl: false
rosbag_filename: ''
log_level: info
output: screen
enable_color: true
rgb_camera.color_profile: 0,0,0
rgb_camera.color_format: RGB8
rgb_camera.enable_auto_exposure: true
enable_depth: true
enable_infra: false
enable_infra1: false
enable_infra2: false
depth_module.depth_profile: 0,0,0
depth_module.depth_format: Z16
depth_module.infra_profile: 0,0,0
depth_module.infra_format: RGB8
depth_module.infra1_format: Y8
depth_module.infra2_format: Y8
depth_module.exposure: 8500
depth_module.gain: 16
depth_module.hdr_enabled: false
depth_module.enable_auto_exposure: true
depth_module.exposure.1: 7500
depth_module.gain.1: 16
depth_module.exposure.2: 1
depth_module.gain.2: 16
enable_sync: false
enable_rgbd: false
enable_gyro: false
enable_accel: false
gyro_fps: 0
accel_fps: 0
unite_imu_method: 0
clip_distance: -2.
angular_velocity_cov: 0.01
linear_accel_cov: 0.01
diagnostics_period: 0.0
publish_tf: true
tf_publish_rate: 0.0
pointcloud.enable: false
pointcloud.stream_filter: 2
pointcloud.stream_index_filter: 0
pointcloud.ordered_pc: false
pointcloud.allow_no_texture_points: false
align_depth.enable: false
colorizer.enable: false
decimation_filter.enable: false
spatial_filter.enable: false
temporal_filter.enable: false
disparity_filter.enable: false
hole_filling_filter.enable: false
hdr_merge.enable: false
wait_for_device_timeout: -1.
reconnect_timeout: 6.
75 changes: 49 additions & 26 deletions clearpath_sensors/launch/intel_realsense.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,33 @@
from launch_ros.actions import ComposableNodeContainer, Node
from launch_ros.substitutions import FindPackageShare

CAMERAS = [
'color',
'depth',
'infra1',
'infra2',
'aligned_depth_to_color',
'aligned_depth_to_infra1',
'aligned_dpeth_to_infra2',
]

IMAGES = [
'image_raw',
'image_rect_raw',
]

TOPICS = [
'camera_info',
'metadata',
]

OTHERS = [
'rgbd',
'extrinsics/depth_to_color',
'extrinsics/depth_to_infra1',
'extrinsics/depth_to_infra2',
]


def generate_launch_description():
parameters = LaunchConfiguration('parameters')
Expand All @@ -54,6 +81,27 @@ def generate_launch_description():
'robot_namespace',
default_value='')

remappings = [
('/tf_static', PathJoinSubstitution(['/', robot_namespace, 'tf_static'])),
('~/depth/color/points', 'points'),
]

for camera in CAMERAS:
for image in IMAGES:
remappings.extend([
('~/%s/%s' % (camera, image), '%s/image' % camera),
('~/%s/%s/compressed' % (camera, image), '%s/image/compressed' % camera),
('~/%s/%s/compressedDepth' % (camera, image), '%s/image/compressedDepth' % camera),
('~/%s/%s/theora' % (camera, image), '%s/image/theora' % camera),
])
for topic in TOPICS:
remappings.append(
('~/%s/%s' % (camera, topic), '%s/%s' % (camera, topic))
)

for topic in OTHERS:
remappings.append(('~/%s' % topic, '%s' % topic))

name = 'intel_realsense'
realsense2_camera_node = Node(
package='realsense2_camera',
Expand All @@ -62,32 +110,7 @@ def generate_launch_description():
executable='realsense2_camera_node',
parameters=[parameters],
output='screen',
remappings=[
# Color
('color/image_raw', 'color/image'),
('color/image_raw/compressed', 'color/compressed'),
('color/image_raw/compressedDepth', 'color/compressedDepth'),
('color/image_raw/theora', 'color/theora'),
# Depth
('depth/image_rect_raw', 'depth/image'),
('depth/image_rect_raw/compressed', 'depth/compressed'),
('depth/image_rect_raw/compressedDepth', 'depth/compressedDepth'),
('depth/image_rect_raw/theora', 'depth/theora'),
# Infra1
('infra1/image_rect_raw', 'infra1/image'),
('infra1/image_rect_raw/compressed', 'infra1/compressed'),
('infra1/image_rect_raw/compressedDepth', 'infra1/compressedDepth'),
('infra1/image_rect_raw/theora', 'infra1/theora'),
# Infra2
('infra2/image_rect_raw', 'infra2/image'),
('infra2/image_rect_raw/compressed', 'infra2/compressed'),
('infra2/image_rect_raw/compressedDepth', 'infra2/compressedDepth'),
('infra2/image_rect_raw/theora', 'infra2/theora'),
# Points
('depth/color/points', 'points'),
# TF
('/tf_static', PathJoinSubstitution(['/', robot_namespace, 'tf_static']))
]
remappings=remappings,
)

image_processing_container = ComposableNodeContainer(
Expand Down

0 comments on commit 40a2ef3

Please sign in to comment.