We present a short introduction to Robot Vision. We first present the basic concepts of image publishers and subscribers in ROS2 and then we apply some basic commands to introduce the students to the digital image processing theory; finally, we present some RGBD and point cloud notions and applications.
For a ROS1 version of this project, please refer to here.
Things that you need to install the software and how to install them
You should have ROS2 installed.
You should have OpenCV for ROS2 installed.
Install git:
sudo apt-get install git
Follow the indications here:
https://docs.ros.org/en/humble/Installation.html
If you already have ROS Humble installed, you can reinstall cv_bridge
with the following command:
sudo apt-get install --reinstall ros-humble-cv-bridge
First, create a workspace:
cd ~
mkdir -p robovision_ros2_ws/src
cd ~/robovision_ros2_ws/src
git clone https://github.com/ARTenshi/robovision_ros2.git
This project requires additional data files, available here (Google Drive).
Download those folders into the ~/robovision_ros2_ws/src/robovision_ros2/data/rosbags/
folder.
cd ~/robovision_ros2_ws
colcon build
If there are errors with cv_bridge
, you might need to compile it from source.
- Install Dependencies
sudo apt-get update
sudo apt-get install -y python3-opencv libopencv-dev ros-humble-cv-bridge-msgs
- Set Up Workspace
mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/ros-perception/vision_opencv.git
cd vision_opencv && git checkout humble
- Build and Source
cd ~/ros2_ws
colcon build --packages-select cv_bridge
source ~/ros2_ws/install/setup.bash
(Optional) Add to .bashrc
:
echo "source ~/ros2_ws/install/setup.bash" >> ~/.bashrc
Run the following command in a terminal:
source ~/robovision_ros2_ws/install/setup.bash
ros2 run robovision_images my_publisher ~/robovision_ros2_ws/src/robovision_ros2/data/images/baboon.png
In a second terminal, run these commands:
source ~/robovision_ros2_ws/install/setup.bash
ros2 run robovision_images my_subscriber
Basic concepts on ROS2 image publishers and subscribers can be found here:
To learn how to process RGB images, follow the indications here:
To work with RGBD images, enter here:
Finally, how to use services and clients in ROS2 can be seen here: