When you use this option, it will tell FlightGear not to run the flight model, but instead wait for values from another, external flight model. You can do this by using the "-fdm=external" option. If you want FlightGear to stop interfering, you should stop running the flight model. So once they are changed, they stay that way. Others, like latitude, longitude, time of day, altitude, etc, are not part of flight dynamics. Values like pitch, roll, angle of attack, speed, etc. So if you change them, it will change them back. Some values are inside the flight model equations used by FlightGear.
![flightgear plane flightgear plane](https://i.ytimg.com/vi/kRZHKh9IhWc/hqdefault.jpg)
It has something to do with the flight model. Seems you have been having some problems like this too? Now for the solution. It goes to a 30-deg roll, then comes back in like 0.5 seconds. Even if I try to send it to 90, it goes to 90 and then comes back. The nose should pitch up, right? Well, it goes up, but it doesn't stay there. Suppose I change the pitch attitude (pitch-deg) to 15 degrees. I found the solution! Let me explain the problem again first. + pitch_deg.ToString() + "'" + roll_deg.ToString() + "\n" īyte sendBytes = (str) + altitude_ft.ToString() + "'" + heading_deg.ToString() + "'" String str = latitude_deg.ToString() + "'" + longitude_deg.ToString() + "'" Private void timer1_Tick(object sender, EventArgs e) Private UdpClient sending_UdpClient = new UdpClient() Here's my C# test program which sends the position data over UDP: "-fg-root=C:\Program Files (x86)\FlightGear\data" ^
![flightgear plane flightgear plane](https://www.softwarecrew.com/wp-content/uploads/2014/10/FlightGear-3.2.jpg)
"C:\Program Files (x86)\FlightGear\bin\Win32\fgfs" ^ Here's how I'm calling FlightGear using the command prompt: Any way I could send you that? Thanks for all the help! :) Could not copy/paste the input protocol xml content here. I'm including my run command and C# program.
![flightgear plane flightgear plane](http://i.ytimg.com/vi/C4Oq58hOaww/maxresdefault.jpg)
I get the following message in the command prompt when I run FlightGear: "Error reading data".
Flightgear plane update#
I want to update the six position and orientation values which are "latitude-deg", "longitude-deg", "altitude-ft", "heading-deg", "pitch-deg",and "roll-deg". Thanks a lot! :) I checked it through -httpd=1234 and it all works fine with my version of FlightGear.Īs for the C# program, I don't want to update "altitude-agl-ft". 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.
Flightgear plane plus#
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".
![flightgear plane flightgear plane](https://live.staticflickr.com/65535/51199032250_d990336cb2_z.jpg)
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.