0

I'm struggeling with a problem here. I want to run a bat file which writes a mission to my drone using MAVProxy.

I can start MAVProxy from my bat file but there is something I dont get. When I execute this command: mavproxy.exe --master=com6 --baudrate=57600 MAVProxy starts within the console. Next I want to wait a minute to make sure MAVProxy has a connection with the drone.

In my bat file I used timeout: timeout /t 60. After the minute has passed I want to give a command to MAVProxy which runs in the cmd window. The command I want to give is the following: wp load route.waypoints. However this does not work, the bat file just does not do anything until I CTRL+C in the cmd window.

Does anyone have a clue how to give these commands with a bat file?

My complete bat file:

cd C:\Program Files (x86)\MAVProxy
mavproxy.exe --master=com6 --baudrate=57600
timeout /t 60
wp load route.waypoints

I hope someone know a solution.

viewtYy
  • 15
  • 1
  • 4

2 Answers2

0

Change mavproxy.exe --master=com6 --baudrate=57600 to start mavproxy.exe --master=com6 --baudrate=57600

JJF
  • 2,681
  • 2
  • 18
  • 31
0

Do I understand right? wp load route.waypoints is an input that is requested by mavproxy.exe?

Completely depends on how mavproxy.exe is programmed.

the following could (or could not) work:

(timeout /t 60>nul &echo wp load route.waypoints)|mavproxy.exe --master=com6 --baudrate=57600

If this doesn't work, there is no pure batch solution, but some embedded vba code is able to sendkey to an application.

Stephan
  • 53,940
  • 10
  • 58
  • 91