Merge remote-tracking branch 'origin/main'

# Conflicts:
#	startup.sh
This commit is contained in:
2024-04-11 17:19:55 +02:00
2 changed files with 13 additions and 7 deletions

View File

@@ -2,8 +2,14 @@
## Description
Ce projet sert à l'initialisation d'un robot pour la coupe de france de robotique.
Ce projet sert à l'initialisation d'un robot pour la coupe de france de robotique. Attention les chemains d'accès sont hardcodés dans le script pour des raisons pratiques.
## Fonctionnalités
- Initialisation des différents programmes C++
- Initialisation des différents programmes C++
## Utilisation
```Bash
bash startup.sh
```

View File

@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash
# Bash script for start up all the programs for SERGE
# All programs are started in the background and in parallel
# All the programs are called with their needed arguments
@@ -32,13 +32,13 @@ pids+=($!)
# Fonction pour surveiller la fermeture de l'IHM
monitor_all() {
# Wait for any of the background processes to exit
for pid in "${pids[@]}"; do
if wait $pid; then
# Terminer tous les autres programmes
for pid in $pids; do
if ps -p $pid > /dev/null; then
echo "Program with PID $pid has terminated, stopping other programs"
pkill -P $$ -f "lidar|arucoDetector|ihm_robot"
sleep 1
pkill -p $$ -f "socketServer"
pkill -P $$ -f "socketServer"
break
fi
done