BaroneRosso.it - Forum Modellismo

BaroneRosso.it - Forum Modellismo (https://www.baronerosso.it/forum/)
-   Software (https://www.baronerosso.it/forum/software/)
-   -   Integrazione mavproxy <> bash script (https://www.baronerosso.it/forum/software/365427-integrazione-mavproxy-bash-script.html)

massimilianonball 01 dicembre 16 13:01

Integrazione mavproxy <> bash script
 
Ciao a tutti!!

Vorrei usare un paio di canali liberi sulla mia radio come "input" in alcuni script bash che utilizzo su una raspberry collegata ad una pixhawk sul mio drone.

Quindi in pratica vorrei che usando degli switch sulla radio, mavproxy rilevi il cambiamento del valore PWM del relativo canale e lo "inserisca" ad esempio in una variabile utilizzabile negli script in bash che sto usando.

Ho provato a reindirizzare l'output di mavproxy verso un file oppure ad interagire con i log di mavproxy ..la cosa è abbastanza fattibile, ma io vorrei sapere se qualcuno conosce un metodo più "diretto", tipo un comando dedicato di mavproxy, grazie!!

massimilianonball 10 dicembre 16 16:31

..mi auto rispondo in caso qualcuno dovesse avere lo stesso problema..

Citazione:

pi@raspberrypi:~ $ screen -dmS test
pi@raspberrypi:~ $ screen -r test -p0 -X stuff "mavproxy.py --master=/dev/ttyACM0 --baudrate 57600 --out 192.168.7.57:14550 --aircraft MyCopter"
pi@raspberrypi:~ $ screen -r test -p0 -X stuff "status"
pi@raspberrypi:~ $ screen -r test -p0 -X eval "stuff \015"
pi@raspberrypi:~ $ screen -r test -p0 -X hardcopy -h foglio.txt
pi@raspberrypi:~ $ cat foglio.txt | grep chan8_raw | cut -f3 -d: | cut -f1 -d, | sed '1,${$!d}'
991
pi@raspberrypi:~ $ screen -r test -p0 -X stuff "status"
pi@raspberrypi:~ $ screen -r test -p0 -X eval "stuff \015"
pi@raspberrypi:~ $ screen -r test -p0 -X hardcopy -h foglio.txt
pi@raspberrypi:~ $ cat foglio.txt | grep chan8_raw | cut -f3 -d: | cut -f1 -d, | sed '1,${$!d}'
2015


Tutti gli orari sono GMT +2. Adesso sono le 13:23.

Basato su: vBulletin versione 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
E' vietata la riproduzione, anche solo in parte, di contenuti e grafica. Copyright 1998/2019 - K-Bits P.I. 09395831002