This project implements a therapeutic system based on ROS 2, computer vision, and a simulated humanoid robot. Its purpose is to support the treatment of children with ADHD through a posture memory game guided by the robot, with emotional tracking, auditory feedback, and a mobile application for therapists.
The system consists of three main components:
- A set of ROS 2 nodes responsible for game logic, posture validation, and emotion recognition.
- A simulation environment in Gazebo that represents the humanoid robot.
- An Android mobile application connected via WebSocket to visualize the child’s results and control the game.
- Ubuntu 22.04 LTS (Linux)
Developed for ROS 2 Humble. Follow the official installation guide.
mkdir -p ~/ros2tesis_ws/src
cd ~/ros2tesis_wscd src
git clone https://github.com/RAMEL-ESPOL/Materia-Integradora-Gonzalez-Lucin.git
cd ..Option A — ROS-GZ (Ignition/modern Gazebo)
sudo apt update && sudo apt install -y python3-colcon-common-extensions python3-pip python3-opencv ros-humble-desktop ros-humble-moveit ros-humble-ros2-control ros-humble-ros2-controllers ros-humble-ros-gz ros-humble-gz-ros2-control ros-humble-rosbridge-suite ros-humble-warehouse-ros-mongo ros-humble-usb-cam ros-humble-xacroOption B — Classic Gazebo
sudo apt update && sudo apt install -y python3-colcon-common-extensions python3-pip python3-opencv ros-humble-desktop ros-humble-moveit ros-humble-ros2-control ros-humble-ros2-controllers ros-humble-gazebo-ros ros-humble-rosbridge-suite ros-humble-warehouse-ros-mongo ros-humble-usb-cam ros-humble-xacrorosdep update
rosdep install --from-paths src --ignore-src -r -ypython3 -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtcolcon build
source install/setup.bashAdd to .bashrc:
echo "source ~/ros2tesis_ws/install/setup.bash" >> ~/.bashrcros2 launch yaren_gazebo_sim coco_robot.launch.pyAlternative (for low-resource CPU/GPU computers):
LIBGL_ALWAYS_SOFTWARE=1 ros2 launch yaren_gazebo_sim coco_robot.launch.pyros2 run yaren_services launch_master_service.pyros2 launch rosbridge_server rosbridge_websocket_launch.xmlDeveloped in Kotlin (Android Studio).
- Open the project in Android Studio.
- Connect a physical device or emulator.
- Run the project.
Inside the app:
- Enter the IP of the computer running ROS 2.
- Press Connect.
- Start the game or access reports.
| Package | Function |
|---|---|
posture_game |
Game logic, feedback, statistics, posture validation, robot movement, emotion detection |
coco_gazebo_sim |
Gazebo simulation environment to visualize robot movements |
coco_services |
Service to send patient names and remotely start launches |
rosbridge_server |
WebSocket communication with the mobile app |
coco_ws |
Contains robot information such as URDF, xacro, RViz and Gazebo communication, plus additional implementations |
dynamixel_sdk |
Communication layer between ROS 2 and ROBOTIS Dynamixel servomotors |
| File | Function |
|---|---|
game_manage_node.py |
Node that controls game logic, feedback, statistics, and assistance |
detect_emotions_node.py |
Node that processes images and classifies them using a trained machine learning model |
mediapipe_node.py |
Node that performs image processing with MediaPipe and publishes raw topics for other nodes |
speaker_node.py |
Node that converts text to speech via a TTS system |
checker_node.cpp |
Node that validates postures according to response time and required pose |
movement_publisher_node.cpp |
Node that publishes robot joint configuration commands to move the robot |
postures.cpp |
Script containing conditions to validate a posture based on MediaPipe landmarks |
Can I use the system without the physical robot?
Yes. It works entirely in simulation using Gazebo.
Which camera is recommended?
Any USB camera compatible with usb_cam.
Where are the reports stored?
As .json files, accessible from the mobile app.
Where can I find the mobile application repository?
The repository is available at: https://github.com/RAMEL-ESPOL/YarenApp.git