Servers by jDrones

Running APM SITL off board on a Pi?

(Andrew Rabbitt) #1

Okay, so in my amateur code hackings with the Ardupilot codebase I have been trying to do some rate-based operations that need the loop time in the calc. I’m currently running SITL on a Ubuntu VM and X-plane on the base Win7 OS but putting some trace calcs in suggest that the loop time can be quite variable - enough to deviate significantly from the plane.G_Dt loop value which I assume most of the rest of the code is using.
Firstly, is there a simple way to improve the sim performance?
Secondly, could I push SITL off to a Pi or similar and connect to X-plane with a real-world ethernet connection so that I could have the code running on a separate uC? Presumably with a (more) dedicated processor running Ardupilot it may run more consistently?
I’m completely Pi-illiterate so this is a steep gradient for me. Just wondering if it may be worth the effort.
Thoughts appreciated!

(James Pattison) #2

The issue you’re running in to is probably because your front end and backend aren’t lockstepped, so can get out of sync - particularly if you’re graphics heavy. Try using a sim that supports lockstep scheduling. For Plane I can’t remember which option is best (I generally just use the basic inbuilt sitl), but from memory JSBSim is lockstepped.

(Andrew Rabbitt) #3

Hmm. OK, thanks @james_pattison You seem to be suggesting that Ardupilot running in SITL mode is getting at least some of the timebase info from X-plane rather than just pseudo-sensor data. Am I on the right track here? I will have a dig about in the code…

(James Pattison) #4


(Andrew Rabbitt) #5

Cheers for the heads-up, @james_pattison!