From 65d37798244b4a1b082fad74484e60e6394a2e36 Mon Sep 17 00:00:00 2001 From: Chris Ye Date: Thu, 1 Nov 2018 17:32:02 +0800 Subject: [PATCH] update test example for depth_image_proc - rename raw topic as image_transport fixed the issue (https://github.com/ros-perception/image_common/issues/96) - update test example of point_cloud_xyzrgb.launch Signed-off-by: Chris Ye --- .../examples/launch/convert_metric.launch.py | 4 +- .../examples/launch/crop_foremost.launch.py | 4 +- .../examples/launch/disparity.launch.py | 2 +- .../examples/launch/point_cloud_xyz.launch.py | 2 +- .../launch/point_cloud_xyz_radial.launch.py | 4 +- .../launch/point_cloud_xyzi.launch.py | 4 +- .../launch/point_cloud_xyzi_radial.launch.py | 4 +- .../launch/point_cloud_xyzrgb.launch.py | 24 ++- .../examples/launch/register.launch.py | 6 +- .../launch/rviz/point_cloud_xyzrgb.rviz | 179 ++++++++++++++++++ 10 files changed, 215 insertions(+), 18 deletions(-) create mode 100644 depth_image_proc/examples/launch/rviz/point_cloud_xyzrgb.rviz diff --git a/depth_image_proc/examples/launch/convert_metric.launch.py b/depth_image_proc/examples/launch/convert_metric.launch.py index fe6b58f48..174fb7241 100644 --- a/depth_image_proc/examples/launch/convert_metric.launch.py +++ b/depth_image_proc/examples/launch/convert_metric.launch.py @@ -40,9 +40,9 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('image_raw/raw', '/camera/depth/image_rect_raw/raw'), + remappings=[('image_raw', '/camera/depth/image_rect_raw'), ('camera_info', '/camera/depth/camera_info'), - ('image/raw', '/camera/depth/image/raw')]), + ('image', '/camera/depth/image')]), launch_ros.actions.Node( package='composition', node_executable='api_composition_cli', output='screen', arguments=['depth_image_proc', 'depth_image_proc::ConvertMetricNode']), diff --git a/depth_image_proc/examples/launch/crop_foremost.launch.py b/depth_image_proc/examples/launch/crop_foremost.launch.py index d38ec6295..eaf69c570 100644 --- a/depth_image_proc/examples/launch/crop_foremost.launch.py +++ b/depth_image_proc/examples/launch/crop_foremost.launch.py @@ -40,9 +40,9 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('image_raw/raw', '/camera/depth/image_rect_raw/raw'), + remappings=[('image_raw', '/camera/depth/image_rect_raw'), ('camera_info', '/camera/depth/camera_info'), - ('image/raw', '/camera/depth/image/raw')]), + ('image', '/camera/depth/image')]), launch_ros.actions.Node( package='composition', node_executable='api_composition_cli', output='screen', arguments=['depth_image_proc', 'depth_image_proc::CropForemostNode']), diff --git a/depth_image_proc/examples/launch/disparity.launch.py b/depth_image_proc/examples/launch/disparity.launch.py index d0e782348..36267a809 100644 --- a/depth_image_proc/examples/launch/disparity.launch.py +++ b/depth_image_proc/examples/launch/disparity.launch.py @@ -40,7 +40,7 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('left/image_rect/raw', '/camera/depth/image_rect_raw/raw'), + remappings=[('left/image_rect', '/camera/depth/image_rect_raw'), ('right/camera_info', '/camera/depth/camera_info'), ('left/disparity', '/camera/left/disparity')]), launch_ros.actions.Node( diff --git a/depth_image_proc/examples/launch/point_cloud_xyz.launch.py b/depth_image_proc/examples/launch/point_cloud_xyz.launch.py index 5cdf460fa..fcce65e0e 100644 --- a/depth_image_proc/examples/launch/point_cloud_xyz.launch.py +++ b/depth_image_proc/examples/launch/point_cloud_xyz.launch.py @@ -40,7 +40,7 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('image_rect/raw', '/camera/depth/image_rect_raw/raw'), + remappings=[('image_rect', '/camera/depth/image_rect_raw'), ('camera_info', '/camera/depth/camera_info'), ('points', '/camera/depth/points')]), launch_ros.actions.Node( diff --git a/depth_image_proc/examples/launch/point_cloud_xyz_radial.launch.py b/depth_image_proc/examples/launch/point_cloud_xyz_radial.launch.py index b6c511415..626191df1 100644 --- a/depth_image_proc/examples/launch/point_cloud_xyz_radial.launch.py +++ b/depth_image_proc/examples/launch/point_cloud_xyz_radial.launch.py @@ -40,10 +40,10 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('image_raw/raw', '/camera/depth/image_rect_raw/raw'), + remappings=[('image_raw', '/camera/depth/image_rect_raw'), ('camera_info', '/camera/depth/camera_info'), ('points', '/camera/depth/points')]), launch_ros.actions.Node( package='composition', node_executable='api_composition_cli', output='screen', - arguments=['depth_image_proc', 'depth_image_proc::PointCloudXyzRadial']), + arguments=['depth_image_proc', 'depth_image_proc::PointCloudXyzRadialNode']), ]) diff --git a/depth_image_proc/examples/launch/point_cloud_xyzi.launch.py b/depth_image_proc/examples/launch/point_cloud_xyzi.launch.py index 5a7e26504..1e3164f9e 100644 --- a/depth_image_proc/examples/launch/point_cloud_xyzi.launch.py +++ b/depth_image_proc/examples/launch/point_cloud_xyzi.launch.py @@ -40,8 +40,8 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('depth/image_raw/raw', '/camera/depth/image_rect_raw/raw'), - ('intensity/image_raw/raw', '/camera/intensity/image_raw/raw'), + remappings=[('depth/image_raw', '/camera/depth/image_rect_raw'), + ('intensity/image_raw', '/camera/intensity/image_raw'), ('intensity/camera_info', '/camera/intensity/camera_info'), ('points', '/camera/depth/points')]), launch_ros.actions.Node( diff --git a/depth_image_proc/examples/launch/point_cloud_xyzi_radial.launch.py b/depth_image_proc/examples/launch/point_cloud_xyzi_radial.launch.py index b6aa62c49..42be07963 100644 --- a/depth_image_proc/examples/launch/point_cloud_xyzi_radial.launch.py +++ b/depth_image_proc/examples/launch/point_cloud_xyzi_radial.launch.py @@ -40,8 +40,8 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('depth/image_raw/raw', '/camera/depth/image_rect_raw/raw'), - ('intensity/image_raw/raw', '/camera/intensity/image_raw/raw'), + remappings=[('depth/image_raw', '/camera/depth/image_rect_raw'), + ('intensity/image_raw', '/camera/intensity/image_raw'), ('intensity/camera_info', '/camera/intensity/camera_info'), ('points', '/camera/depth/points')]), launch_ros.actions.Node( diff --git a/depth_image_proc/examples/launch/point_cloud_xyzrgb.launch.py b/depth_image_proc/examples/launch/point_cloud_xyzrgb.launch.py index f7608ad7b..f1a71ccf2 100644 --- a/depth_image_proc/examples/launch/point_cloud_xyzrgb.launch.py +++ b/depth_image_proc/examples/launch/point_cloud_xyzrgb.launch.py @@ -35,16 +35,34 @@ from launch import LaunchDescription import launch_ros.actions +import os + +from ament_index_python.packages import get_package_share_directory + def generate_launch_description(): + default_rviz = os.path.join(get_package_share_directory('depth_image_proc'), + 'launch', 'rviz/point_cloud_xyzrgb.rviz') return LaunchDescription([ + # install realsense from https://github.com/intel/ros2_intel_realsense + launch_ros.actions.Node( + package='realsense_ros2_camera', node_executable='realsense_ros2_camera', output='screen'), + + # composition api_composition launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', remappings=[('rgb/camera_info', '/camera/color/camera_info'), - ('rgb/image_rect_color/raw', '/camera/color/image_raw/raw'), - ('depth_registered/image_rect/raw', - '/camera/aligned_depth_to_color/image_raw/raw')]), + ('rgb/image_rect_color', '/camera/color/image_raw'), + ('depth_registered/image_rect', + '/camera/aligned_depth_to_color/image_raw')]), + + # depth_image_proc::PointCloudXyzrgbNode launch_ros.actions.Node( package='composition', node_executable='api_composition_cli', output='screen', arguments=['depth_image_proc', 'depth_image_proc::PointCloudXyzrgbNode']), + + # rviz + launch_ros.actions.Node( + package='rviz2', node_executable='rviz2', output='screen', + arguments=['--display-config', default_rviz]), ]) diff --git a/depth_image_proc/examples/launch/register.launch.py b/depth_image_proc/examples/launch/register.launch.py index dfba396fd..a0b93c42c 100644 --- a/depth_image_proc/examples/launch/register.launch.py +++ b/depth_image_proc/examples/launch/register.launch.py @@ -40,11 +40,11 @@ def generate_launch_description(): return LaunchDescription([ launch_ros.actions.Node( package='composition', node_executable='api_composition', output='screen', - remappings=[('depth/image_rect/raw', '/camera/depth/image_rect_raw/raw'), + remappings=[('depth/image_rect', '/camera/depth/image_rect_raw'), ('depth/camera_info', '/camera/depth/camera_info'), ('rgb/camera_info', '/camera/color/camera_info'), - ('depth_registered/image_rect/raw', - '/camera/depth_registered/image_rect/raw'), + ('depth_registered/image_rect', + '/camera/depth_registered/image_rect'), ('depth_registered/camera_info', '/camera/depth_registered/camera_info')]), launch_ros.actions.Node( package='composition', node_executable='api_composition_cli', output='screen', diff --git a/depth_image_proc/examples/launch/rviz/point_cloud_xyzrgb.rviz b/depth_image_proc/examples/launch/rviz/point_cloud_xyzrgb.rviz new file mode 100644 index 000000000..daba8ef8e --- /dev/null +++ b/depth_image_proc/examples/launch/rviz/point_cloud_xyzrgb.rviz @@ -0,0 +1,179 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /color_image1 + - /depth_image1 + - /registered_depth_image1 + - /PointCloud21 + Splitter Ratio: 0.5 + Tree Height: 392 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Nav Goal1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: color_image + Normalize Range: true + Queue Size: 10 + Topic: /camera/color/image_raw + Unreliable: false + Value: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: depth_image + Normalize Range: true + Queue Size: 10 + Topic: /camera/depth/image_rect_raw + Unreliable: false + Value: true + - Class: rviz_default_plugins/Image + Enabled: true + Max Value: 1 + Median window: 5 + Min Value: 0 + Name: registered_depth_image + Normalize Range: true + Queue Size: 10 + Topic: /camera/aligned_depth_to_color/image_raw + Unreliable: false + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/PointCloud2 + Color: 255; 255; 255 + Color Transformer: RGB8 + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 4096 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: PointCloud2 + Position Transformer: XYZ + Queue Size: 10 + Selectable: true + Size (Pixels): 3 + Size (m): 0.009999999776482582 + Style: Flat Squares + Topic: /camera/depth_registered/points + Unreliable: false + Use Fixed Frame: true + Use rainbow: true + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: camera_color_optical_frame + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Topic: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: /move_base_simple/goal + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 1.8979061841964722 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: -1.5597962141036987 + Target Frame: + Value: Orbit (rviz) + Yaw: 4.718582630157471 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1145 + Hide Left Dock: false + Hide Right Dock: true + QMainWindow State: 000000ff00000000fd0000000400000000000002740000041ffc020000000bfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000213000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb000000160063006f006c006f0072005f0069006d0061006700650100000256000000a20000002800fffffffb0000001600640065007000740068005f0069006d00610067006501000002fe000000a90000002800fffffffb0000002c0072006500670069007300740065007200650064005f00640065007000740068005f0069006d00610067006501000003ad000000af0000002800ffffff000000010000010f0000041ffc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d0000041f000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000004c30000041f00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: true + Width: 1853 + X: 67 + Y: 27 + color_image: + collapsed: false + depth_image: + collapsed: false + registered_depth_image: + collapsed: false