mirror of
https://github.com/modelec/Initialisation.git
synced 2026-03-18 21:30:40 +01:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # startup.sh
This commit is contained in:
10
README.MD
10
README.MD
@@ -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
|
||||
```
|
||||
10
startup.sh
10
startup.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user