12many

  • **
  • 66
I was playing around with GCS last night and was able to get the flight simulator going without too much trouble.  Here are a few tips if people want to try it out themselves:

(I'm using a Ubuntu 16.04 in a VM)
1. I built LibrePilot using the instructions here:  https://librepilot.atlassian.net/wiki/display/LPDOC/Linux+-+Building+and+Packaging
    --> I pulled code from the 'next' branch as of 16.06.12 in case it matters

2. Once you have LP running, build simposix (FC emulator) by executing 'make simposix' (builds with warnings)

3. Install the FlightGear flight simulator from here: https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear
    --> run it and make sure it runs properly.  Use 'fgfs --launcher' to set your aircraft, location etc, then exit the app
    --> Note:  I had problems getting OpenGL working in my Vmware VM, but setting the Vm to version-9 compatibility solved that

4. Open a new shell window and run simposix.elf (in build/firmware/fw_simposix/)

5. Now run GCS.  If simposix is running properly you should be able to go to the Configuration page.  Set your vehicle type to Fixed Wing and assign your output channels (motor=channel1, aileron 1=channel2, elevator 1=channel3, rudder=channel4).  Save. 

6. Go to the HITL page.  Select Window / Edit Gagets Mode.  Change the top widget to 'FlightGear HITL'.

7. Click Start at the top of the HITL widget.  If everything is working properly FlightGear should load and you should be able to use the HITL page Controller widget to take off and fly around.

8. At this point you should be able to use GCS to fly around & navigate normally.  I've had issues with getting the default vehicle to navigate properly, but it's probably something in my settings.

This is all from memory, so I probably forgot something...  Feel free to post with questions & corrections.

Disclaimer:  I deserve absolutely NO credit; actually I'm relatively new to LibrePilot.  Kudos to the hard working developers who made all of this a reality!  Also, fair warning:   There are some rough edges - this stuff is under active development and subject to change.  (Still, it's fun to play around with and get familiar with GCS features without risking your hardware!)


hwh

  • *
  • 1018
Re: How to get flight simulator mode (using FlightGear) working
« Reply #1 on: June 13, 2016, 03:49:24 am »
Nice writeup on how to set it up.  :)

You don't actually need to compile simposix.  If you plug in a flight controller GCS will send the calcs to the board instead of to simposix.  It works on Linux for me.  I haven't tried it but that way you should be able to run on Windows and OS-X.

Re: How to get flight simulator mode (using FlightGear) working
« Reply #2 on: July 28, 2017, 06:06:12 am »
Hi ,
Flight Gear Seems like a great simulator for HITL.

I am currently using Mac OS 10.12 and FlightGear2017.2.1 .
When I start GCS HITL I am getting the following command 'bash: line 1: \usr\games\fgfs: command not found' , which is understand is not valid for mac as it lies in ~/Library/Application Support/FlightGear.

So my question is , if I separately start FlightGear, how do I ensure the connection is established between FlightGear and GCS. Also is there a way of launching FlightGear directly from GCS, if thats the case where in the src code of GCS I need to exactly make the necessary changes.

Thank you,
Prashin

f5soh

  • *****
  • 4572
    • LibrePilot
Re: How to get flight simulator mode (using FlightGear) working
« Reply #3 on: July 28, 2017, 01:02:09 pm »
No need code changes, you simply need to adjust the paths according to your system in Tools > Options > HITL simulation > FlightGear HITL



For source code there is all the links in http://www.librepilot.org website.
Wiki also explain how to build from sources: https://librepilot.atlassian.net/wiki/display/LPDOC/Mac+-+Building+and+Packaging

Re: How to get flight simulator mode (using FlightGear) working
« Reply #4 on: August 03, 2017, 05:55:47 am »
Thanks will try it out...