High-level control software for a mobile robot, leveraging the ros2_control framework to communicate with sensors and a low-level microcontroller, achieving real-time human tracking and following.
The algorithm was successfully implemented and tested on a custom-built mobile platform:
- Main Processing Unit: Raspberry Pi 5 (8GB RAM recommended - handling ROS 2 nodes and computer vision tasks).
- Low-Level Controller: Any microcontroller capable of communicating with the RPi5 via SPI to control the motors (e.g., Raspberry Pi Pico 2, STM32).
- Vision Sensor: Raspberry Pi Camera Module HD v2 (connected via CSI port).
- Distance/Depth Sensor: VL53L8CX (64-zone Time-of-Flight sensor)
- Operating System: Ubuntu Server 24.04 with Real-Time (RT) kernel enabled
- Middleware: ROS 2 Jazzy Jalisco.
- Control Framework:
ros2_control
- Create a workspace and clone the repository:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone [https://github.com/Szymi039/ros2-human-follower.git](https://github.com/Szymi039/ros2-human-follower.git)- Install dependencies:
cd ~/ros2_ws
rosdep install --from-paths src -y --ignore-src- Build the packages:
colcon build --symlink-install- Source the workspace:
source install/setup.bash- Standard Operation (Human Following)
ros2 launch my_robot_bringup my_robot.launch.py- Manual Teleoperation
ros2 launch my_robot_bringup my_robot.launch.py tracker:=falseOn another terminal use:
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diff_drive_controller/cmd_vel -p stamped:=true -p speed:=0.50 -p turn:=4.0- Sensor Data Visualization (configure RViz2 for PointCloud2 messages)
ros2 launch my_robot_bringup my_robot.launch.py broadcaster:=true
