|
| 1 | +# Copyright 2018 Open Source Robotics Foundation, Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Launch face detection and rviz.""" |
| 16 | + |
| 17 | +import os |
| 18 | + |
| 19 | +from ament_index_python.packages import get_package_share_directory |
| 20 | +from launch import LaunchDescription |
| 21 | +import launch_ros.actions |
| 22 | + |
| 23 | + |
| 24 | +def generate_launch_description(): |
| 25 | + default_yaml = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'param', 'pipeline_object_oss_topic.yaml'); |
| 26 | + default_rviz = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'launch', 'rviz/default.rviz'); |
| 27 | + return LaunchDescription([ |
| 28 | + # Realsense |
| 29 | + launch_ros.actions.Node( |
| 30 | + package='realsense_ros2_camera', node_executable='realsense_ros2_camera',output='screen'), |
| 31 | + # Openvino Detection |
| 32 | + launch_ros.actions.Node( |
| 33 | + package='dynamic_vino_sample', node_executable='pipeline_with_params', |
| 34 | + arguments=['-config', default_yaml], |
| 35 | + remappings=[ |
| 36 | + ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), |
| 37 | + ('/openvino_toolkit/detected_objects', '/ros2_openvino_toolkit/detected_objects'), |
| 38 | + ('/openvino_toolkit/images', '/ros2_openvino_toolkit/image_rviz')], |
| 39 | + output='screen'), |
| 40 | + |
| 41 | + # Rviz |
| 42 | + launch_ros.actions.Node( |
| 43 | + package='rviz2', node_executable='rviz2', output='screen', |
| 44 | + arguments=['--display-config', default_rviz]), |
| 45 | + ]) |
0 commit comments