SITL strange behaviour

Hi All, 

I'm in the process of refactoring the runsim.py code to allow the use of FDM connectors that interface to JSBSim or XPlane, however in doing so I've hit a hurdle where SITL is behaving strangely.

Unfortunately I have no baseline of a correctly working FDM packet as the auto test suite also exhibited odd behaviour using JSBSim whereby the aircraft would rotate and pitch up, bank which either lead to a stall or a poorly coordinated turn resulting in the aircraft facing down and eventual crash.

Attached are the logs for a an aircraft on the runway.  Viewing Mission Planner while SITL is active and aircraft is on the runway has the AH indicating roll of about 10-15 degrees when actual should be 0.6 degrees.

Here is a snapshot of the values being packed into the FDM packet:

time (usec): 1401964722530685,
heading (deg): 166.509552,
roll speed (rad/s): 0.000000,
pitch speed (rad/s): 0.000000,
yaw speed (rad/s): 0.000000,
lat: 33.684734,
lon: -117.730003,
alt: 0,
vx: 0, vy: 0, vz: 0,
ias (m/s): 0, tas (m/s) 0,
x accel (m/s/s): 0.114370, y accel (m/s/s): 2.746574, z accel (m/s/s): -9.823327
pitch:-0.251376 roll:0.662242 yaw:180.111160

SIM entry in the data flash log:


Any ideas where it got 655.130 for pitch?

Also logging documentation indicates that pitch, roll, yaw values should be in centi-degrees, these don't seem to be logged in centi-degrees.

3691126122?profile=original

Corresponding mission planner view

Mission planner seems to plot the aircraft at the right location on the map, but reported values for pitch, roll, yaw seem to be all over the place and jittery:

3691126231?profile=original

I'm sure I'm must be passing a wrong value somewhere, or some other trivial issue.

Keen to get this working to give everyone a choice of using JSBSIM or XPlane for their SITL simulations.

Thanks

-Michael Dove

1.BIN

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    Post this also to the dev google group drones-discuss, thx
    • Posted. Thanks for the tip Bill.

This reply was deleted.