Building/running Tools/autotest/sim_vehicle.py - is jsbsim used?

@tridge I’m building a docker image for running ardupilotTools/autotest/sim_vehicle.py based on ubuntu/bionic and noticed that tridge/jsbsim project fails to build. I checked on my bionic vagrant box and jsbsim is similarly failing to build there.

But sim_vehicle.py works just fine (compiles itself etc).

Is tridge/jsbsim still used/necessary to be git cloned + built? e.g. from https://github.com/ArduPilot/ardupilot/blob/master/Tools/vagrant/initvagrant.sh#L53-L56

Any ideas why sim_vehicle.py builds + runs despite ~/jsbim/src/JSBSim not successfully building?

I remembered that vagrant up was failing for me but didn’t seem to matter (https://gist.github.com/drnic/7684ce449ef5cfa965166ddd907dd36a “Perhaps the provision step fails; it might not matter. Carry on.”) – I didn’t document what was failing; but I guess it was the build of jsbsim.

On a good note - here is SITL running inside Docker, exposing X11 to host MacOS.

@tridge bonus question: I would like to precompile all/most of sim_vehicle.py during docker build. Do you have some pro tip suggestions for me?

Currently I can only get the 470+ items to compile when running sim_vehicle.py resulting in a long running process (or an error if X11 isn’t available, etc)

Tools/autotest/sim_vehicle.py -j $(nproc) --console --map --out=$HOST_IP:14550 -v APMrover2 -L Kingaroy

BTW the error making jsbsim is:

$ make
Making all in src
make[1]: Entering directory '/home/vagrant/jsbsim/src'
Making all in initialization
make[2]: Entering directory '/home/vagrant/jsbsim/src/initialization'
  CXX      FGSimplexTrim.o
In file included from ../../src/math/FGStateSpace.h:27:0,
                 from FGSimplexTrim.h:23,
                 from FGSimplexTrim.cpp:20:
../../src/models/propulsion/FGTurbine.h:297:3: error: ‘FGParameter’ does not name a type; did you mean ‘FGThruster’?
   FGParameter *N1SpoolUp;
   ^~~~~~~~~~~
   FGThruster
../../src/models/propulsion/FGTurbine.h:298:3: error: ‘FGParameter’ does not name a type; did you mean ‘FGThruster’?
   FGParameter *N1SpoolDown;
   ^~~~~~~~~~~
   FGThruster
../../src/models/propulsion/FGTurbine.h:299:3: error: ‘FGParameter’ does not name a type; did you mean ‘FGThruster’?
   FGParameter *N2SpoolUp;
   ^~~~~~~~~~~
   FGThruster
../../src/models/propulsion/FGTurbine.h:300:3: error: ‘FGParameter’ does not name a type; did you mean ‘FGThruster’?
   FGParameter *N2SpoolDown;
   ^~~~~~~~~~~
   FGThruster
../../src/models/propulsion/FGTurbine.h:310:1: error: expected class-name before ‘{’ token
 {
 ^
Makefile:445: recipe for target 'FGSimplexTrim.o' failed
make[2]: *** [FGSimplexTrim.o] Error 1
make[2]: Leaving directory '/home/vagrant/jsbsim/src/initialization'
Makefile:612: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/vagrant/jsbsim/src'
Makefile:387: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

I’ve found the solution to prebuilding within the docker image - https://github.com/drnic/ardupilot/blob/dockerfile-rebuild-sitl/Dockerfile#L26-L30

Plus then use sim_vehicle.py --no-rebuild to avoid recompiling.