c++ - Executing a command shell from popen and set other command shell -
I am working with Quadroਟਰ and Mavalink in a project. I have successfully installed mavproxy in my Ubuntu PC and have run it without problems from the terminal. When I run When you execute I have When I run this C ++ program the terminal shows only one that will appear if I was running If you read the program, the I am reading about the popping function, but I have not got the right form to do this. I know that I can use the I'm not sure I understand your question, but I think you Read the output along with sending the command to If so, you have to change the open mode of mavproxy.py from the terminal and connects to a square robot with support for MVLC (APM autoplot), then detects the Mawproxy Quadrotor and everything is fine.
mavproxy.py , the program starts sending and receiving many parameters in the terminal. You can write some parameters in the terminal to use for any configuration. For example, in the terminal,
help command:
$ mavlink.py. Data donor Fixed & gt; "When the program terminates configuration, you are allowed to input any parameters, for example," STABILIZE &
mavlink.py Has a code to execute from C ++
include
& lt; Iostream & gt; Include & lt; Stdio.h & gt; using namespace std; Int main () {FILE * in; Four buff [512]; If (! (In = popen ("mavlink.py", "r"))) {return1; } While (fgets (in fond, size (fond))! = Null) {cout & lt; & Lt; Fond } Pckloc (In); Return 0; }
mavproxy.py from the terminal, but I do not know how I can send commands like
help in C ++ code
while the statement allows me to capture
mavproxy.py and
cout The parameter generated, but
mavlink.py does not end at any time unless you type something in the terminal exits or press CTRL + C So that
while the loop does not end.
mavlink.h library in my program and send the parameter to the square controller, but not
mavlink.h want to do this.
mavlink.py .
popen () to "
r " to "
w "So that you can write, then you can send commands like this:
FILE * fp; Char * command = "HELP"; If (! (Fp = popen ("mavlink.py", "w"))) {return1; Filitt (command, size (four), strangel (command), fp);
Comments
Post a Comment