![]() Check the button next to "Vertical Speed" and ensure "0" is entered as the desired value.Check the box next to "Heading Control".Check the button next to "Heading Bug" and enter "0" as the desired heading.Press F11 to open the autopilot dialog.We need to get straight and level, flying north. Let's be lazy! Although the Allegro aircraft has minimal avionics, FlightGear provides us with a generic autopilot to control it. Need a breather? Press P at any time to pause the simulator. Try and keep yourself about level, but don't worry if you climb in a spiral - we just need to gain height. When you get into the air, use the left and right arrow keys to bank, but use only small taps and then back to centre. ![]() (If you really want to fly it, use 0 and Enter to steer using the rudder.) Just let the aircraft accelerate and after about five seconds, hit the down arrow twice, and you should take to the air.Press S and hold for a second to start the engine.Press } three times to turn on the ignition.(You might see a little knob move in the cockpit.) Press "Page Up" and hold for 5 seconds, to get the throttle all the way open.The Allegro is a fairly forgiving trainer aircraft so will almost fly itself. but we need to get our aircraft in the air before we can do much. You can do this at any time, and the last set of signals both read from and written to FlightGear will be plotted for you. Kill the python script and now run python3 fgplot.py and you should see a plot similar to the one below. These mean, respectively, that Python is able to read your vertical speed and fiddle with your elevator. You should see numbers appear, changing but very close to zero, and if you go back over to FlightGear and press H (for head-up display) you should see an indicator move over on the left. Now, in a second terminal, run python3 test_interface.py. If you have Python 3 as your default, perhaps in a virtual environment, you can just type python. The 'telnet' bit opens a server port for us to access and manipulate the simulator data - this is the back door for Python.Īll the Python code in this tutorial needs Python 3.x, hence all the examples are shown to be run using the python3 command. Otherwise FlightGear uses the real time at the simulated location - and it's dark in Hawaii. The 'timeofday' bit ensures you have daylight. The 'aircraft' but selects the Allegro-2000 with wheels and the 'fg-aircraft' tells FlightGear where to find it. You could install it anywhere, but I recommend putting it in your new control_tutorial folder:įgfs -aircraft=allegroW -fg-aircraft= -timeofday=morning -telnet=5051 Instead, we'll use an add-on aircraft that is easy to fly and easy to customize: the Allegro 2000 (wheeled version). The default aircraft models in FlightGear all have fancy autopilots that are hard to mess around with. Python FlightGear InterfaceĬlone this repository somewhere on your PC: git clone The Allegro 2000 Aircraft ![]() Time for a cup of tea: it's quite a big install. Install FlightGear using sudo apt install flightgear. See also the instruction video on Youtube. We will implement those programs in Python, using a custom interface class provided in this project. Job of representing the aircraft dynamics, and provides an easy back door for interfacing with external programs. We'll use FlightGear as its free, makes a good We're using aircraft as a case study for control because the dynamics responses are interesting but,įor the trainer aircraft we'll experiment with, quite forgiving. This is the Linux version! See also the Windows version.Ĭontrol tutorial examples using FlightGear simulator. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |