Set-up build environment on Linux
Linux is one of the easiest os'es to set-up as most packages and libraries can be found in the package repositories.
Ubuntu and Debian
We currently support Ubuntu Noble (24.04) 64-bit x86 and 64-bit ARM.
Use this guide to install ROS 2 Jazzy Jalisco on your system.
Make sure ros cv bridge is installed as well,
sudo apt install ros-jazzy-cv-bridge
If you have not installed VSCode yet, do not install using APT in ubuntu as it will install the sandboxed snap version.
Which has many issues due to the sandbox environment
Use this guide instead, which installs it using the APT repository from Microsoft themselves.
Compiling and running the example
The library contains a ROS2 package example demonstrating the usage and functionality of this library.
To compile and run this example:
-
Clone this repo:
git clone https://github.com/CLFML/Face_Detector.Cpp.git
-
Open the cloned repo folder in a terminal
-
Source your ROS2 installation:
source /opt/ros/jazzy/setup.bash
-
Install the ros2 dependencies:
rosdep install --from-paths src -y --ignore-src
-
Build the package with more verbose output
colcon build --event-handlers console_direct+ --packages-select face_detector
Note that, whenever build errors occur, and you need to clean the build, use
rm -rf build install log
rm -rf ~/.ros
- Set up the environment
source install/setup.bash
- With the environment sourced, we can run executables built by colcon. Let’s run the camera node from the examples:
ros2 run v4l2_camera v4l2_camera_node
-
In another terminal, let’s run the face detector node (don’t forget to source the setup script):6
ros2 run face_detector face_detector_node
-
In yet another terminal, let’s run the viewer node:
ros2 run face_detector face_detector_viewer
Now, you should see the camera stream, with annotations produced by the face detector.