al-dev

  • *
  • 1
SITL testing & CI for LibrePilot
« on: April 06, 2016, 06:24:30 pm »
Hi everyone,

I am new to the community so I hope this is the right place to post : I was wondering if the LibrePilot project had a dedicated simulator program for Software In The Loop (SITL) testing, and how it compared in maturity to the simulation tools for other open-source projects like ArduPilot ( http://ardupilot.org/dev/docs/simulation-2.html )?
If there is such a simulator, are they any plans to include SITL simulations in the Continuous Integration process for LibrePilot, taking maybe a few selected drone models as references for the flight dynamics model ?

I have seen this post: https://forum.librepilot.org/index.php?topic=872.0 but it seems that the OP was asking more about HITL, and I could not find links to the documentation based on the answers that were made.

I am fairly new to drones but I have some academic/industry background in robotics and software development, so I am trying to get a sense of the development and testing process for LibrePilot.

Thanks!

Re: SITL testing & CI for LibrePilot
« Reply #1 on: May 25, 2016, 10:17:31 pm »
Hi,
I have the same question.
I found this article: https://sites.google.com/site/xrdroid/our-company/our-staff
Here the author explains how to run a simulator.

The issue I have now is building the fw_simposix. It does not appear when I build fw_all. The target sim_osx seems to broken.

I want to play around with firmware development without crashing my quad :)

Thanks for your support!

hwh

  • *
  • 1018
Re: SITL testing & CI for LibrePilot
« Reply #2 on: May 25, 2016, 11:28:46 pm »
...I found this article: https://sites.google.com/site/xrdroid/our-company/our-staff...
That's a six year old post on a site that was never finished and hasn't been updated since, things have changed.

Support for flightgear and xplane are built into GCS now.   HITL tab, window->edit gadgets mode, select the one you want.  Turn off gadgets mode.  Then tools -> options ->HITL simulation to configure the one you selected.

I use it to fly with xplane10 sometimes. 

xfce

  • **
  • 88
Re: SITL testing & CI for LibrePilot
« Reply #3 on: May 26, 2016, 03:04:54 am »
...I found this article: https://sites.google.com/site/xrdroid/our-company/our-staff...
That's a six year old post on a site that was never finished and hasn't been updated since, things have changed.

Support for flightgear and xplane are built into GCS now.   HITL tab, window->edit gadgets mode, select the one you want.  Turn off gadgets mode.  Then tools -> options ->HITL simulation to configure the one you selected.

I use it to fly with xplane10 sometimes. 
Could you please write a detailed guide for this ?

Re: SITL testing & CI for LibrePilot
« Reply #4 on: May 26, 2016, 06:51:04 pm »
Thanks, yes a guide would be great.
I've got flightgear running in your described way, but I have no idea how to run any firmware. Do I have to? And were would I start when I want to start programming for the firmware and try it in a simulator?
Especially it would be nice to know how to do all the things for a quadcopter.

hwh

  • *
  • 1018
Re: SITL testing & CI for LibrePilot
« Reply #5 on: May 26, 2016, 10:43:35 pm »
I reloaded linux on my computer about a month ago and haven't reloaded X-Plane10 yet.   I'm downloading it now but I have a slow connection so it'll be a while.

I originally set it up following this video but adjusting for HITL instead of SITL and for some changes since it was done.   For today it's all I can give you but we will put together a wiki page on it.



Re: SITL testing & CI for LibrePilot
« Reply #6 on: May 27, 2016, 08:43:40 pm »
Thanks, I already watched that video. Currently my missing link is the simulated firmware that you run in the console. No idea where to get or how to build that from the current sources.

hwh

  • *
  • 1018
Re: SITL testing & CI for LibrePilot
« Reply #7 on: May 28, 2016, 03:27:05 am »
On my linux system when I build it ends up in build/firmware/fw_simposix/.   The file is called fw_simposix.elf.    I'm not sure if it builds on other platforms since I don't have them available to check.

I've been just plugging in a real board and using HITL instead of SITL.

Re: SITL testing & CI for LibrePilot
« Reply #8 on: May 28, 2016, 11:01:49 am »
ah, I see ther is the issue:
https://bitbucket.org/librepilot/librepilot/src/bc571d3365f18ea425b2d92d55c8f35e5acf9c08/flight/Makefile?at=next&fileviewer=file-view-default

# SimPosix only builds on Linux so drop it from the list for
# all other platforms.
ifneq ($(UNAME), Linux)
    ALL_BOARDS := $(filter-out simposix, $(ALL_BOARDS))
endif

I'll see if I'm able to compile this on my Mac. I'll let you know

Re: SITL testing & CI for LibrePilot
« Reply #9 on: June 10, 2016, 11:11:51 pm »
Seems like the simulator code is not compatible with clang. A lot of erros which are not trivial to fix. So no luck with compiling simposix on mac :(

hwh

  • *
  • 1018
Re: SITL testing & CI for LibrePilot
« Reply #10 on: June 10, 2016, 11:54:38 pm »
You don't really need simposix unless you don't own any compatible boards. Just plug in any cc3d or revo and HITL works fine.  It ends up working the same as simposix, it just uses the processor and firmware on the board.  It software disconnects the boards sensors and motors and only uses it to do the calculations, just like simposix does.

Re: SITL testing & CI for LibrePilot
« Reply #11 on: June 13, 2016, 09:02:31 pm »
Good to know, thanks!
Do you know if/how I can use the hitl to simulate a quadcopter? I want to play around with a selfmade PID controller.

hwh

  • *
  • 1018
Re: SITL testing & CI for LibrePilot
« Reply #12 on: June 13, 2016, 09:48:38 pm »
LP and it's HITL simulate whatever it's set to.   The flight simulator (flightgear or xplane9/10) may not support a quadcopter. I haven't looked into quads on either of those but they might support them.   

I haven't tried it but the third simulator listed on the HITL tab is AeroSimRc and that seems to have support for quads.  It's a commercial program and seems to be windows only. http://www.aerosimrc.com/en/home.htm There seems to be a download for a demo that only does 2 minute flights.