![]() ![]() After connecting press enter a few times and you should get a prompt saying " ArduPlane V2.76]". On my system this was on /dev/ttyACM0, baud rate 115200, 8 data bits, no parity, 1 stop bit. These can either be adjusted by connecting a terminal emulator such a minicom or the internal terminal in QGroundControl to the ArduPilot. To make the aircraft fly properly I had to adjust some of the autopilot settings. The resulting hex file is placed in /tmp/ArdPlane.build/ArduPlane.hexįlash it to the ArduPilot by connecting the ArduPilot and running: avrdude -pm2560 -cstk500v2 -P/dev/ttyACM0 -Uflash:w:/tmp/ArduPlane.build/ArduPlane.hex:i Setup the build environment by running the Tools/scripts/install-prereqs-ubuntu.sh script in the ardupilot directory.īuild the HIL version of the ardupilot by running: cd ArduPlane & make config & make apm2-hilsensors.The Ardupilot will need to be flashed with different autopilot to normal. Step 3 - Build and flash the HIL autopilot Download the Rascal 110 model and extract the zip to /usr/share/games/flightgear/Aircraft.Copy the MavLink.xml file to /usr/share/games/flightgear/Protocol (you'll need root access).Install Flight Gear from the normal Ubuntu repository.Included in the Tools/FlightGear directory (from ) there is an XML file called MAVLink.xml. Anything from the property tree can be exported or imported over a network link which is defined by an XML file. There are still a few warnings produced by the compile process, but it should produce an executable called FGShim.įlightGear is really extensible and every internal variable can be accessed through its property tree. ![]() To compile it run the following commands: You can get an updated version from my Github at. However I couldn't get the version of FGShim included with Ardupilot (in December 2013) to compile and the MAVLink formats it was sending differed from those the rest of the Ardupilot code was expecting.įGShim depends upon other components of the Ardupilot so you need the entire source tree to build it. This program is supposed to sit between the Ardupilot and Flightgear, reading control surface commands from the Ardupilot via serial/USB and then relaying them to Flightgear via UDP and taking back Flightgear's position, velocity and orientation outputs and sending them back to the Ardupilot to form sensor data. I found that there is a program called FGShim in the Tools/FlightGear directory inside the Ardupilot source. These instructions are based upon using Ubuntu 12.04 with GCC 4.6, but they should work on any modern Linux distribution and with a little modification on OSX and Windows. I also notice that both the APM Mission Planner on Windows and QGroundControl have GUIs that are supposed to launch a simulator and do all of this for you, but I couldn't get either of them to work properly. I'm running this on Ubuntu Linux 12.04, but most of it should work on Windows or Mac but i've not tested it. Luckily I managed to get it working and thought I'd share how I did it. Recently I wanted to test some code that was intended for a real UAV so this wasn't an option, I spent a lot of time looking for up to date instructions but couldn't find any. A hardware in the loop simulation uses the real ArduPilot, your radio control unit, the servos and motors in an aircraft but the autopilot outputs are passed to a flight simulator which returns simulated sensor data.Ī few years ago I used a highly modified version of the Ardupilot to control a Flight Gear simulation, but had modified the code almost beyond recognition and was running it natively on my PC instead of on an Arduino. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |