ROS 2 OpenVINO™ Toolkit Sample Application#
This tutorial tells you how to run the segmentation demo application on both a static image and on a video stream received from a Intel® RealSense™ camera.
Run the Sample Application#
Check if your installation has the amr-ros2-openvino Docker* image.
docker images |grep amr-ros2-openvino #if you have it installed, the result is: amr-ros2-openvino
Note
If the image is not installed, continuing with these steps triggers a build that takes longer than an hour (sometimes, a lot longer depending on the system resources and internet connection).
If the image is not installed, Intel® recommends installing the Robot Base Kit or Robot Complete Kit with the Get Started Guide for Robots.
Check that EI for AMR environment is set:
echo $AMR_TUTORIALS # should output the path to EI for AMR tutorials /home/user/edge_insights_for_amr/Edge_Insights_for_Autonomous_Mobile_Robots_2023.1/AMR_containers/01_docker_sdk_env/docker_compose/05_tutorials
If nothing is output, refer to Get Started Guide for Robots Step 5 for information on how to configure the environment.
Launch the automated execution of the ROS 2 OpenVINO™ toolkit sample applications:
docker compose -f $AMR_TUTORIALS/ros2_openvino.tutorial.yml up
Expected output:
Execution of the object segmentation sample code input from the image: This takes one minute, and you can see the semantic segmentation being applied to the image.
Original image
Image with semantic object segmentation
Execution of the object segmentation sample code input from the Intel® RealSense™ camera topic: This requires a Intel® RealSense™ camera connected to the testing target. It takes one minute, and you can see the semantic segmentation being applied to the video stream received from a Intel® RealSense™ camera.
To close this, do the following:
Type
Ctrl-c
in the terminal where you did the up command.Run this command to remove stopped containers:
docker compose -f $AMR_TUTORIALS/ros2_openvino.tutorial.yml down
How it Works#
All of the commands required to run this tutorial are documented in:
01_docker_sdk_env/docker_compose/05_tutorials/ros2_openvino.tutorial.yml
To use your own image to run semantic segmentation:
Copy your image into the
AMR_containers
folder at:cp <path_to_image>/my_image.jpg 01_docker_sdk_env/docker_compose/05_tutorial/param/
Edit
01_docker_sdk_env/docker_compose/05_tutorials/ros2_openvino.tutorial.yml
, at line 34, adding the following command:sudo cp ${CONTAINER_BASE_PATH}/01_docker_sdk_env/docker_compose/05_tutorials/param/my_image.jpg ../ros2_ws/src/ros2_openvino_toolkit/data/images/
Edit
01_docker_sdk_env/docker_compose/05_tutorials/param/pipeline_segmentation_image.yaml
to change theinput_path:
, line 4:input_path: /home/eiforamr/ros2_ws/src/ros2_openvino_toolkit/data/images/my_image.jpg
Run the automated yml:
docker compose -f 01_docker_sdk_env/docker_compose/05_tutorials/ros2_openvino.tutorial.yml up
Expected result: Execution of semantic segmentation on the image you selected
Troubleshooting#
For general robot issues, go to: Troubleshooting for Robot Tutorials.