![]() ![]() Add the controls to the main form as pictured in the screenshot: Now lets write a program in C#, which will send the input data to and receive output data from Flightgear. ![]() It will again give error( Error reading data), because no one send data to the input. Now copy those files to the "C:\Program Files (x86)\FlightGear\data\Protocol" directory and run the program again. The following is "outputtprotocol.xml" file's content,which describes the same 3 values from input and plus one more (the speed of aircraft). The following is "inputprotocol.xml" file's content, which describes 3 values, that the program will wait for input(aileron, elevator and throttle). Now if the hanging is over, then the program must give an error(see console's screen), because "outputprotocol" and "inputprotocol" files doesn't exists. If the program hangs, this means you are using the Flightgear version 2.0.0, which has a known bug and you need to downgrade to the version 1.9.1. The second generic argument means: Use sockets again, for getting data from out, 10 times a second, skip the ip address, using the port 49000, use UDP protocol again, the coming data described in the file "inputprotocol". The first generic argument means: Use sockets, for sending data out, 10 times a second, to the 127.0.0.1 machine(this is localhost's ip address), using the port 49001, use UDP protocol, the actual data which sent out are described in file "outputprotocol". There is a command line option "-generic", which can be used for modifying items of property tree(see previous article, about Run the program with the following options. Today's topic will be about controlling aircraft through sockets from another program. In the previous article the Flightgear program's some features were discussed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |