Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ROS2 Version supported:
* [x] ROS2 Dashing
* [x] ROS2 Eloquent
* [x] ROS2 Foxy
* [x] ROS2 Galactic

Inference Features supported:

Expand All @@ -26,10 +27,10 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open

## Prerequisite

* Processor: A platform with Intel processors assembled. (see [here](https://software.intel.com/content/www/us/en/develop/articles/openvino-2020-3-lts-relnotes.html) for the full list of Intel processors supported.)
* Processor: A platform with Intel processors assembled. (see [here](https://software.intel.com/content/www/us/en/develop/articles/openvino-2021-4-lts-relnotes.html) for the full list of Intel processors supported.)
* OS: Ubuntu 20.04
* ROS2: Foxy Fitzroy
* OpenVINO: V2021.3, see [the release notes](https://software.intel.com/content/www/us/en/develop/articles/openvino-relnotes.html) for more info.
* ROS2: Galactic Geochelone
* OpenVINO: V2021.4, see [the release notes](https://software.intel.com/content/www/us/en/develop/articles/openvino-relnotes.html) for more info.
* [Optional] RealSense D400 Series Camera
* [Optional] Intel NCS2 Stick
## Tables of contents
Expand All @@ -40,10 +41,9 @@ See more from [here](https://github.com/openvinotoolkit/openvino) for Intel Open
- [How to create multiple pipelines in a process?](./doc/tables_of_contents/tutorials/Multiple_Pipelines.md)

## Installation & Launching
See Getting Start Pages for [ROS2 Dashing](./doc/getting_started_with_Dashing.md) or [ROS2 Foxy](./doc/getting_started_with_Foxy_Ubuntu20.04.md) for detailed installation & lauching instructions.
See Getting Start Pages for [ROS2 Dashing](./doc/getting_started_with_Dashing.md) or [ROS2 Foxy](./doc/getting_started_with_Foxy_Ubuntu20.04.md) or [ROS2 Galactic](./doc/getting_started_with_Galactic_Ubuntu20.04.md) for detailed installation & lauching instructions.

# More Information
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw

###### *Any security issue should be reported using process at https://01.org/security*

117 changes: 117 additions & 0 deletions doc/getting_started_with_Galactic_Ubuntu20.04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# ROS2_GALACTIC_OpenVINO_Toolkit

**NOTE:**
Below steps have been tested on **Ubuntu 20.04**.

## 1. Environment Setup
* Install ROS2 Galactic ([guide](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html))
* Install Intel® OpenVINO™ Toolkit Version: 2021.4 ([guide](https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_apt.html)) or building by source code ([guide](https://github.com/openvinotoolkit/openvino/wiki/BuildingForLinux))
* Install Intel® RealSense ™ SDK ([guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md))

## 2. Building and Installation
* Build demo code in OpenVINO toolkit
```
# root is required instead of sudo
source /opt/intel/<INSTALL_DIR>/bin/setupvars.sh
cd /opt/intel/<INSTALL_DIR>/deployment_tools/open_model_zoo/demos
source build_demos.sh
```
* Install ROS2_OpenVINO packages
```
mkdir -p ~/my_ros2_ws/src
cd ~/my_ros2_ws/src
git clone https://github.com/intel/ros2_openvino_toolkit -b dev-ov.2021.4
git clone https://github.com/intel/ros2_object_msgs
git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2
```
* Build package
```
source /opt/ros/galactic/setup.bash
source /opt/intel/<INSTALL_DIR>/bin/setupvars.sh
cd ~/my_ros2_ws/src
colcon build --symlink-install
source ./install/local_setup.bash
```

## 3. Running the Demo
* Preparation
* Configure the Neural Compute Stick USB Driver (if needed)
```
cd ~/Downloads
cat <<EOF > 97-usbboot.rules
SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF
sudo cp 97-usbboot.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo ldconfig
rm 97-usbboot.rules
```

* See all available models
```
cd /opt/intel/<INSTALL_DIR>/deployment_tools/open_model_zoo/tools/downloader
sudo python3 downloader.py --print_all
```

* Download the optimized Intermediate Representation (IR) of model (execute once), for example:
```
cd /opt/intel/<INSTALL_DIR>/deployment_tools/open_model_zoo/tools/downloader
sudo python3 downloader.py --name face-detection-adas-0001 --output_dir /opt/openvino_toolkit/models/face_detection/output
```

* copy label files (execute once)
```
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/emotions-recognition/output/intel/emotions-recognition-retail-0003/FP32/
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP32/
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP16/
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP32/
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/semantic-segmentation/output/FP16/
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/vehicle-license-plate-detection/output/intel/vehicle-license-plate-detection-barrier-0106/FP32
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP32/
sudo cp ~/my_ros2_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/face_detection/output/intel/face-detection-adas-0001/FP16/
```

* If the model (tensorflow, caffe, MXNet, ONNX, Kaldi)need to be converted to intermediate representation (For example the model for object detection)
```
sudo python3 downloader.py --name mobilenet-ssd --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output
cd /opt/intel/<INSTALL_DIR>/deployment_tools/model_optimizer
sudo python3 mo.py --input_model /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output/public/mobilenet-ssd/mobilenet-ssd.caffemodel --output_dir /opt/openvino_toolkit/models/object_detection/mobilenet_ssd/caffe/output
```

* Before launch, check the parameter configuration in ros2_openvino_toolkit/sample/param/xxxx.yaml, make sure the paramter like model path, label path, inputs are right.
* run face detection sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_people.launch.py
```
* run face detection sample code input from Image.
```
ros2 launch dynamic_vino_sample pipeline_image.launch.py
```
* run object segmentation sample code input from RealSenseCameraTopic.
```
ros2 launch dynamic_vino_sample pipeline_segmentation.launch.py
```
* run object segmentation sample code input from Image.
```
ros2 launch dynamic_vino_sample pipeline_segmentation_image.launch.py
```
* run vehicle detection sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_vehicle_detection.launch.py
```
* run person attributes sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_person_attributes.launch.py
```
* run person reidentification sample code input from StandardCamera.
```
ros2 launch dynamic_vino_sample pipeline_reidentification.launch.py
```

# More Information
* ROS2 OpenVINO discription writen in Chinese: https://mp.weixin.qq.com/s/BgG3RGauv5pmHzV_hkVAdw

###### *Any security issue should be reported using process at https://01.org/security*
2 changes: 1 addition & 1 deletion sample/src/image_object_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main(int argc, char ** argv)

auto result = client->async_send_request(request);
if (rclcpp::spin_until_future_complete(node, result) ==
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
auto srv = result.get();

Expand Down
2 changes: 1 addition & 1 deletion sample/src/image_people_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char ** argv)
auto result = client->async_send_request(request);

if (rclcpp::spin_until_future_complete(node, result) ==
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
auto people = result.get();
if (people->persons.emotions.size() == 0 && people->persons.agegenders.size() == 0 &&
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
####################################

message(STATUS "Looking for inference engine configuration file at: ${CMAKE_PREFIX_PATH}")
find_package(InferenceEngine 1.1)
find_package(InferenceEngine)
if(NOT InferenceEngine_FOUND)
message(FATAL_ERROR "")
endif()
Expand Down
2 changes: 1 addition & 1 deletion tests/src/service/unittest_objectService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST(UnitTestObject, testObject)
auto result = client->async_send_request(request);

ASSERT_EQ(
rclcpp::executor::FutureReturnCode::SUCCESS,
rclcpp::FutureReturnCode::SUCCESS,
rclcpp::spin_until_future_complete(node, result));

auto srv = result.get();
Expand Down
2 changes: 1 addition & 1 deletion tests/src/service/unittest_peopleService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TEST(UnitTestPeople, testPeople)
auto result = client->async_send_request(request);

ASSERT_EQ(
rclcpp::executor::FutureReturnCode::SUCCESS,
rclcpp::FutureReturnCode::SUCCESS,
rclcpp::spin_until_future_complete(node, result));

auto srv = result.get();
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_faceDetectionCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ static bool headPose_test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_face_reidentification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ static bool test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_imageCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ static bool headPose_test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_objectDetectionCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ static bool test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_reidentification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ static bool test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_segmentationCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ static bool test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/topic/unittest_vehicleDetectionCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ static bool test_pass = false;

template<typename DurationT>
void wait_for_future(
rclcpp::executor::Executor & executor, std::shared_future<bool> & future,
rclcpp::Executor & executor, std::shared_future<bool> & future,
const DurationT & timeout)
{
using rclcpp::executor::FutureReturnCode;
rclcpp::executor::FutureReturnCode future_ret;
using rclcpp::FutureReturnCode;
rclcpp::FutureReturnCode future_ret;
auto start_time = std::chrono::steady_clock::now();
future_ret = executor.spin_until_future_complete(future, timeout);
auto elapsed_time = std::chrono::steady_clock::now() - start_time;
Expand Down