Welcome to the CDFR-Programme-Robot project!
This project aims to develop a program to control a robot for the CDFR event.
This program enables the robot to perform various tasks such as navigation, data collection, and more using a modular and extensible design.
- Navigation: The robot can move through its environment using dedicated algorithms.
- Data Collection: The robot gathers and stores data from onboard sensors.
- Communication: The program supports communication with other systems or devices.
Before running the program, make sure you have installed the following dependencies:
sudo apt-get install make gcc g++ python3-venv libasio-devFor ARM (Raspberry Pi) compilation, install:
sudo apt-get install g++-aarch64-linux-gnuFor debugging, install:
sudo apt install gdbserver-
Do not clone this repository by itself!
Instead, clone the main CDFR repository with the--recursiveflag to include all submodules:git clone git@github.com:robotronik/CDFR.git --recursive
-
Navigate to the CDFR-Programme-Robot directory:
cd informatique/CDFR-Programme-Robot/ -
Switch to the
mainbranch and update the project:git checkout main git pull
To compile the program on your machine, simply run:
makeTo run tests:
make testsTo clean the build files:
make cleanEnsure you have the necessary dependencies for ARM compilation.
To compile and deploy the program on your Raspberry Pi, first set up SSH key authentication. To copy your SSH key to the Raspberry Pi (replace pi@192.168.1.47 with your Raspberry Pi’s address):
ssh-copy-id pi@192.168.1.47Then compile and deploy with:
make deployTo clean up, run:
make clean-allOn a new Raspberry Pi, configure I2C and serial communication via:
sudo raspi-configTo view the service logs:
journalctl -b -u programCDFR --output=cat
journalctl -u programCDFR -f --output=catTo list the active services:
systemctl list-units --type=serviceTo reload the service configuration and restart the program:
sudo systemctl daemon-reload
sudo systemctl restart programCDFRTo ensure a backup of the logs
sudo nano /etc/systemd/journald.confand add
[Journal]
Storage=persistent
SyncIntervalSec=2s- Connect your PC to the same Wi-Fi network as the Raspberry Pi.
- Update the IP address in
launch.jsonandtask.jsonto match your robot's address. - Press F5 in VS Code to start remote debugging, set breakpoints, and utilize VS Code's debugging tools.
Ensure that both the robot and the program are running and that you are on the same local network. Then, open your browser and go to:
http://raspitronik.localTo set up the touchscreen kiosk mode on the Raspberry Pi, first disable NTP and set the date to avoid SSL issues:
sudo timedatectl set-ntp false
sudo timedatectl set-time '2025-12-02 19:40:00'
sudo apt-get update
sudo apt-get upgrade -yThen, install Xorg, Openbox, and Chromium if not already installed:
sudo apt install libcamera-apps
sudo apt-get install xorg openbox chromium-browser
sudo apt install xorg openbox -y
export DISPLAY=:0
sudo startx /usr/bin/chromium-browser --noerrdialogs --kiosk http:localhost/robot --incognito --disable-extensions --no-sandboxAlternatively, use:
/usr/bin/chromium-browser --kiosk http:localhost/robot --incognito --disable-extensionsFor configuring a long display, edit the configuration file:
sudo nano /boot/firmware/config.txtAnd add the following line:
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Automatically load initramfs files, if found
auto_initramfs=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-waveshare-panel,8_8_inch
max_framebuffers=2
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
# disable_fw_kms_setup=1If you are running the Raspberry Pi OS with the default desktop, you can add the command to the autostart file so it launches when the X session starts:
-
Open (or create if it doesn’t exist) the autostart file:
mkdir -p /home/robotronik/.config/autostart nano /home/robotronik/.config/autostart/kiosk.desktop
-
Add the following command:
@/usr/bin/chromium-browser --kiosk http://localhost/robot --incognito --disable-extensions
✅ Correct setup for Debian 13 (GNOME / Wayland)
Create the file:
~/.config/autostart/kiosk.desktop
With this content:
[Desktop Entry]
Type=Application
Name=Kiosk Mode
Exec=bash -c "sleep 5 && /usr/bin/chromium --kiosk http://localhost/robot --incognito --no-first-run --no-default-browser-check --password-store=basic"
X-GNOME-Autostart-enabled=trueThen:
chmod +x ~/.config/autostart/kiosk.desktopThat’s the correct GNOME-compatible autostart format.
- Save the file and reboot the system.
In the code, these elements are referred to as banner, stocks, columns, platforms, and tribunes. Defined in constante.h:
- Stepper 1: Platforms elevator
- Stepper 2: Multi-level elevator
- Stepper 3: Lower revolver
- Servo 1: Tribunes pusher
- Servo 2: Left platforms lifter
- Servo 3: Right platforms lifter
- Servo 4: Clamps
- Servo 5: String Claws
- Servo 6: Banner Front
- Servo 7: Banner Back
- DC Motor 1: Tribunes elevator
- SOLID:
- 🟢 Green: The robot has finished the match.
- BLINKING:
- 🔴 Red: The program has failed. Restart the robot.
- 🔵 Blue: The robot is ready to start as blue.
- 🟡 Yellow: The robot is ready to start as yellow.
- 🟣 Purple: The robot is in manual control mode.
- RAINBOW:
- 🌈 The robot is waiting for user input.
- Position the robot.
- Setup mechanical parts.
- Choose color.
- Select strategy (verify on the live table).
- Ready to start.