mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-03 22:48:28 -04:00
SITL: fixed JSBSim backend for latest version
This commit is contained in:
parent
c5a2065a86
commit
f8407dd33a
@ -141,7 +141,7 @@ bool JSBSim::create_templates(void)
|
||||
fprintf(f,
|
||||
"<?xml version=\"1.0\"?>\n"
|
||||
"<initialize name=\"Start up location\">\n"
|
||||
" <latitude unit=\"DEG\"> %f </latitude>\n"
|
||||
" <latitude unit=\"DEG\" type=\"geodetic\"> %f </latitude>\n"
|
||||
" <longitude unit=\"DEG\"> %f </longitude>\n"
|
||||
" <altitude unit=\"M\"> 1.3 </altitude>\n"
|
||||
" <vt unit=\"FT/SEC\"> 0.0 </vt>\n"
|
||||
@ -291,7 +291,7 @@ bool JSBSim::open_control_socket(void)
|
||||
char startup[] =
|
||||
"info\n"
|
||||
"resume\n"
|
||||
"step\n"
|
||||
"iterate 1\n"
|
||||
"set atmosphere/turb-type 4\n";
|
||||
sock_control.send(startup, strlen(startup));
|
||||
return true;
|
||||
@ -351,7 +351,7 @@ void JSBSim::send_servos(const struct sitl_input &input)
|
||||
"set atmosphere/wind-mag-fps %f\n"
|
||||
"set atmosphere/turbulence/milspec/windspeed_at_20ft_AGL-fps %f\n"
|
||||
"set atmosphere/turbulence/milspec/severity %f\n"
|
||||
"step\n",
|
||||
"iterate 1\n",
|
||||
aileron, elevator, rudder, throttle,
|
||||
radians(input.wind.direction),
|
||||
wind_speed_fps,
|
||||
|
@ -99,28 +99,25 @@ public:
|
||||
double longitude; // geodetic (radians)
|
||||
double latitude; // geodetic (radians)
|
||||
double altitude; // above sea level (meters)
|
||||
float agl; // above ground level (meters)
|
||||
float phi; // roll (radians)
|
||||
float theta; // pitch (radians)
|
||||
float psi; // yaw or true heading (radians)
|
||||
float alpha; // angle of attack (radians)
|
||||
float beta; // side slip angle (radians)
|
||||
float agl; // above ground level (meters)
|
||||
float phi; // roll (radians)
|
||||
float theta; // pitch (radians)
|
||||
float psi; // yaw or true heading (radians)
|
||||
float alpha; // angle of attack (radians)
|
||||
float beta; // side slip angle (radians)
|
||||
|
||||
// Velocities
|
||||
float phidot; // roll rate (radians/sec)
|
||||
float thetadot; // pitch rate (radians/sec)
|
||||
float psidot; // yaw rate (radians/sec)
|
||||
float vcas; // calibrated airspeed
|
||||
float climb_rate; // feet per second
|
||||
float v_north; // north velocity in local/body frame, fps
|
||||
float v_east; // east velocity in local/body frame, fps
|
||||
float v_down; // down/vertical velocity in local/body frame, fps
|
||||
float v_wind_body_north; // north velocity in local/body frame
|
||||
// relative to local airmass, fps
|
||||
float v_wind_body_east; // east velocity in local/body frame
|
||||
// relative to local airmass, fps
|
||||
float v_wind_body_down; // down/vertical velocity in local/body
|
||||
// frame relative to local airmass, fps
|
||||
float phidot; // roll rate (radians/sec)
|
||||
float thetadot; // pitch rate (radians/sec)
|
||||
float psidot; // yaw rate (radians/sec)
|
||||
float vcas; // calibrated airspeed
|
||||
float climb_rate; // feet per second
|
||||
float v_north; // north velocity in local/body frame, fps
|
||||
float v_east; // east velocity in local/body frame, fps
|
||||
float v_down; // down/vertical velocity in local/body frame, fps
|
||||
float v_body_u; // ECEF velocity in body axis
|
||||
float v_body_v; // ECEF velocity in body axis
|
||||
float v_body_w; // ECEF velocity in body axis
|
||||
|
||||
// Accelerations
|
||||
float A_X_pilot; // X accel in body frame ft/sec^2
|
||||
@ -128,26 +125,26 @@ public:
|
||||
float A_Z_pilot; // Z accel in body frame ft/sec^2
|
||||
|
||||
// Stall
|
||||
float stall_warning; // 0.0 - 1.0 indicating the amount of stall
|
||||
float slip_deg; // slip ball deflection
|
||||
float stall_warning; // 0.0 - 1.0 indicating the amount of stall
|
||||
float slip_deg; // slip ball deflection
|
||||
|
||||
// Pressure
|
||||
|
||||
// Engine status
|
||||
uint32_t num_engines; // Number of valid engines
|
||||
uint32_t eng_state[FG_MAX_ENGINES];// Engine state (off, cranking, running)
|
||||
float rpm[FG_MAX_ENGINES]; // Engine RPM rev/min
|
||||
float fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
|
||||
float fuel_px[FG_MAX_ENGINES]; // Fuel pressure psi
|
||||
float egt[FG_MAX_ENGINES]; // Exhuast gas temp deg F
|
||||
float cht[FG_MAX_ENGINES]; // Cylinder head temp deg F
|
||||
float mp_osi[FG_MAX_ENGINES]; // Manifold pressure
|
||||
float tit[FG_MAX_ENGINES]; // Turbine Inlet Temperature
|
||||
float oil_temp[FG_MAX_ENGINES]; // Oil temp deg F
|
||||
float oil_px[FG_MAX_ENGINES]; // Oil pressure psi
|
||||
uint32_t num_engines; // Number of valid engines
|
||||
uint32_t eng_state[FG_MAX_ENGINES]; // Engine state (off, cranking, running)
|
||||
float rpm[FG_MAX_ENGINES]; // Engine RPM rev/min
|
||||
float fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
|
||||
float fuel_px[FG_MAX_ENGINES]; // Fuel pressure psi
|
||||
float egt[FG_MAX_ENGINES]; // Exhuast gas temp deg F
|
||||
float cht[FG_MAX_ENGINES]; // Cylinder head temp deg F
|
||||
float mp_osi[FG_MAX_ENGINES]; // Manifold pressure
|
||||
float tit[FG_MAX_ENGINES]; // Turbine Inlet Temperature
|
||||
float oil_temp[FG_MAX_ENGINES]; // Oil temp deg F
|
||||
float oil_px[FG_MAX_ENGINES]; // Oil pressure psi
|
||||
|
||||
// Consumables
|
||||
uint32_t num_tanks; // Max number of fuel tanks
|
||||
uint32_t num_tanks; // Max number of fuel tanks
|
||||
float fuel_quantity[FG_MAX_TANKS];
|
||||
|
||||
// Gear status
|
||||
@ -175,6 +172,7 @@ public:
|
||||
float speedbrake;
|
||||
float spoilers;
|
||||
|
||||
// nasty hack .... JSBSim sends in little-endian
|
||||
void ByteSwap(void);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user