From 4f52d0fec491c0add2c3e223cef5dacb1910da12 Mon Sep 17 00:00:00 2001 From: RachelRen05 Date: Mon, 28 Jan 2019 10:36:40 +0800 Subject: [PATCH 1/5] open source add object lancun to support connect oa --- .../pipeline_object_oss_topic.launch.py | 45 +++++++++++++++++++ sample/param/pipeline_object_oss_topic.yaml | 22 +++++++++ 2 files changed, 67 insertions(+) create mode 100644 sample/launch/pipeline_object_oss_topic.launch.py create mode 100644 sample/param/pipeline_object_oss_topic.yaml diff --git a/sample/launch/pipeline_object_oss_topic.launch.py b/sample/launch/pipeline_object_oss_topic.launch.py new file mode 100644 index 00000000..8158da7c --- /dev/null +++ b/sample/launch/pipeline_object_oss_topic.launch.py @@ -0,0 +1,45 @@ +# Copyright 2018 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Launch face detection and rviz.""" + +import os + +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +import launch_ros.actions + + +def generate_launch_description(): + default_yaml = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'param', 'pipeline_object_oss_topic.yaml'); + default_rviz = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'launch', 'rviz/default.rviz'); + return LaunchDescription([ + # Realsense + launch_ros.actions.Node( + package='realsense_ros2_camera', node_executable='realsense_ros2_camera',output='screen'), + # Openvino Detection + launch_ros.actions.Node( + package='dynamic_vino_sample', node_executable='pipeline_with_params', + arguments=['-config', default_yaml], + remappings=[ + ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/detected_objects', '/ros2_openvino_toolkit/detected_objects'), + ('/openvino_toolkit/images', '/ros2_openvino_toolkit/image_rviz')], + output='screen'), + + # Rviz + launch_ros.actions.Node( + package='rviz2', node_executable='rviz2', output='screen', + arguments=['--display-config', default_rviz]), + ]) diff --git a/sample/param/pipeline_object_oss_topic.yaml b/sample/param/pipeline_object_oss_topic.yaml new file mode 100644 index 00000000..4a1f0fc5 --- /dev/null +++ b/sample/param/pipeline_object_oss_topic.yaml @@ -0,0 +1,22 @@ +Pipelines: +- name: object + inputs: [RealSenseCameraTopic] + infers: + - name: ObjectDetection + model: /opt/openvino_toolkit/open_model_zoo/model_downloader/object_detection/common/ssd/300/caffe/output/ssd300.xml + engine: CPU + label: to/be/set/xxx.labels + batch: 16 + outputs: [ImageWindow, RosTopic, RViz] + confidence_threshold: 0.2 + connects: + - left: RealSenseCameraTopic + right: [ObjectDetection] + - left: ObjectDetection + right: [ImageWindow] + - left: ObjectDetection + right: [RosTopic] + - left: ObjectDetection + right: [RViz] + +OpenvinoCommon: From 440f8d52899c8dc26756ad0ae6e37aa1bab16d22 Mon Sep 17 00:00:00 2001 From: RachelRen05 Date: Mon, 28 Jan 2019 10:37:18 +0800 Subject: [PATCH 2/5] binary add object launch to support connect oa --- sample/launch/pipeline_object_topic.launch.py | 46 +++++++++++++++++++ sample/param/pipeline_object_topic.yaml | 22 +++++++++ 2 files changed, 68 insertions(+) create mode 100644 sample/launch/pipeline_object_topic.launch.py create mode 100644 sample/param/pipeline_object_topic.yaml diff --git a/sample/launch/pipeline_object_topic.launch.py b/sample/launch/pipeline_object_topic.launch.py new file mode 100644 index 00000000..0da02d1d --- /dev/null +++ b/sample/launch/pipeline_object_topic.launch.py @@ -0,0 +1,46 @@ +# Copyright 2018 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Launch face detection and rviz.""" + +import os + +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +import launch_ros.actions + + +def generate_launch_description(): + default_yaml = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'param', 'pipeline_object_topic.yaml'); + default_rviz = os.path.join(get_package_share_directory('dynamic_vino_sample'), 'launch', 'rviz/default.rviz'); + return LaunchDescription([ + #realsense + launch_ros.actions.Node( + package='realsense_ros2_camera', node_executable='realsense_ros2_camera',output='screen'), + + #openvino detection + launch_ros.actions.Node( + package='dynamic_vino_sample', node_executable='pipeline_with_params', + arguments=['-config', default_yaml], + remappings=[ + ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/detected_objects', '/ros2_openvino_toolkit/detected_objects'), + ('/openvino_toolkit/images', '/ros2_openvino_toolkit/image_rviz')], + output='screen'), + + #rviz + launch_ros.actions.Node( + package='rviz2', node_executable='rviz2', output='screen', + arguments=['--display-config', default_rviz]), + ]) diff --git a/sample/param/pipeline_object_topic.yaml b/sample/param/pipeline_object_topic.yaml new file mode 100644 index 00000000..1a4c65bf --- /dev/null +++ b/sample/param/pipeline_object_topic.yaml @@ -0,0 +1,22 @@ +Pipelines: +- name: object + inputs: [RealSenseCameraTopic] + infers: + - name: ObjectDetection + model: /opt/intel/computer_vision_sdk/deployment_tools/intel_models/person-vehicle-bike-detection-crossroad-0078/FP32/person-vehicle-bike-detection-crossroad-0078.xml + engine: CPU + label: to/be/set/xxx.labels + batch: 16 + outputs: [ImageWindow, RosTopic, RViz] + confidence_threshold: 0.2 + connects: + - left: RealSenseCameraTopic + right: [ObjectDetection] + - left: ObjectDetection + right: [ImageWindow] + - left: ObjectDetection + right: [RosTopic] + - left: ObjectDetection + right: [RViz] + +OpenvinoCommon: From 315f36ad93a63424c2746c1bd790fd149f499cfe Mon Sep 17 00:00:00 2001 From: RachelRen05 Date: Mon, 28 Jan 2019 10:37:50 +0800 Subject: [PATCH 3/5] modify subscribed topic --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22eb71c3..f281cbac 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Currently, the inference feature list is supported: ### Topic #### Subscribed Topic - Image topic: -```/camera/color/image_raw```([sensor_msgs::msg::Image](https://github.com/ros2/common_interfaces/blob/master/sensor_msgs/msg/Image.msg)) +```/openvino_toolkit/image_raw```([sensor_msgs::msg::Image](https://github.com/ros2/common_interfaces/blob/master/sensor_msgs/msg/Image.msg)) #### Published Topic - Face Detection: ```/ros2_openvino_toolkit/face_detection```([object_msgs:msg:ObjectsInBoxes](https://github.com/intel/ros2_object_msgs/blob/master/msg/ObjectsInBoxes.msg)) From bd8252c5532f4b246d92f4f500b646b17065a56e Mon Sep 17 00:00:00 2001 From: RachelRen05 <38059915+RachelRen05@users.noreply.github.com> Date: Sun, 27 Jan 2019 21:52:50 -0500 Subject: [PATCH 4/5] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f281cbac..a1accd4c 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,10 @@ One-step installation scripts are provided for the dependencies' installation. P ```bash ros2 launch dynamic_vino_sample pipeline_object_oss.launch.py ``` +* run object detection sample code input from RealSenseCameraTopic. + ```bash + ros2 launch dynamic_vino_sample pipeline_object_oss_topic.launch.py + ``` * run object segmentation sample code input from RealSenseCameraTopic. ```bash ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py From d6837fbf87c63e5da5bee0cc83b1084fbffd3cf5 Mon Sep 17 00:00:00 2001 From: RachelRen05 <38059915+RachelRen05@users.noreply.github.com> Date: Sun, 27 Jan 2019 21:54:05 -0500 Subject: [PATCH 5/5] Update BINARY_VERSION_README.md --- doc/BINARY_VERSION_README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/BINARY_VERSION_README.md b/doc/BINARY_VERSION_README.md index 8bb1ebcc..4ce6deba 100644 --- a/doc/BINARY_VERSION_README.md +++ b/doc/BINARY_VERSION_README.md @@ -164,6 +164,10 @@ This project is a ROS2 wrapper for CV API of [OpenVINO™](https://software.inte ```bash ros2 launch dynamic_vino_sample pipeline_object.launch.py ``` +* run object detection sample code input from RealSenseCameraTopic. + ```bash + ros2 launch dynamic_vino_sample pipeline_object_topic.launch.py + ``` * run object segmentation sample code input from RealSenseCameraTopic. ```bash ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py