Skip to content

Commit

Permalink
update XPlane model
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Aug 28, 2024
1 parent ec14b5f commit b6fa556
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
28 changes: 28 additions & 0 deletions ArduPlane/SA/xplane_plane.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# XPlane DREF map file for a simple plane
# assumes: Aileron, Elevator, Throttle, Rudder, flaps

{
"settings" : { "debug" : 0 },

"sim/operation/override/override_joystick" : { "type" : "fixed", "value" : 1 },
"sim/operation/override/override_throttles" : { "type" : "fixed", "value" : 1 },

# ailerons
"sim/flightmodel2/wing/elevator1_deg[12]" : { "type" : "angle", "range" : 20, "channel" : 1 }, # right rear
"sim/flightmodel2/wing/elevator1_deg[13]" : { "type" : "angle", "range" : -20, "channel" : 9 }, # left rear
"sim/flightmodel2/wing/elevator1_deg[14]" : { "type" : "angle", "range" : 20, "channel" : 1 }, # front right
"sim/flightmodel2/wing/elevator1_deg[15]" : { "type" : "angle", "range" : -20, "channel" : 9 }, # front left

# "sim/cockpit2/controls/wingsweep_ratio" : { "type" : "fixed", "value" : 0}, # wings unsweep when deploy (disabled)

# joystick inputs
"axis6" : { "type" : "joyaxis", "channel" : 1, "input_min" : 0.2, "input_max" : 0.8 },
"axis5" : { "type" : "joyaxis", "channel" : 2, "input_min" : 0.2, "input_max" : 0.8 },
"axis4" : { "type" : "joyaxis", "channel" : 3, "input_min" : 0.8, "input_max" : 0.2 },
"axis2" : { "type" : "joyaxis", "channel" : 4, "input_min" : 0.2, "input_max" : 0.9 },
"axis3" : { "type" : "joyaxis", "channel" : 5, "input_min" : 0.2, "input_max" : 0.9 },
"button1" : { "channel" : 6, "mask" : 1 },
"button2" : { "channel" : 7, "mask" : 2 },
"button3" : { "type" : "joybutton", "channel" : 8, "mask" : 24 },
"button4" : { "type" : "joybutton", "channel" : 9, "mask" : 4 }
}
18 changes: 6 additions & 12 deletions Tools/autotest/models/xplane_plane.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@
"sim/operation/override/override_joystick" : { "type" : "fixed", "value" : 1 },
"sim/operation/override/override_throttles" : { "type" : "fixed", "value" : 1 },

# forward throttle, up to 4 engines
"sim/flightmodel/engine/ENGN_thro_use[0]" : { "type" : "range", "range" : 1, "channel" : 3 },
"sim/flightmodel/engine/ENGN_thro_use[1]" : { "type" : "range", "range" : 1, "channel" : 3 },
"sim/flightmodel/engine/ENGN_thro_use[2]" : { "type" : "range", "range" : 1, "channel" : 3 },
"sim/flightmodel/engine/ENGN_thro_use[3]" : { "type" : "range", "range" : 1, "channel" : 3 },
# ailerons
"sim/flightmodel2/wing/elevator1_deg[12]" : { "type" : "angle", "range" : 20, "channel" : 1 }, # right rear
"sim/flightmodel2/wing/elevator1_deg[13]" : { "type" : "angle", "range" : -20, "channel" : 9 }, # left rear
"sim/flightmodel2/wing/elevator1_deg[14]" : { "type" : "angle", "range" : 20, "channel" : 1 }, # front right
"sim/flightmodel2/wing/elevator1_deg[15]" : { "type" : "angle", "range" : -20, "channel" : 9 }, # front left

# control surfaces, using yoke positions not surface overrides
"sim/joystick/yoke_roll_ratio" : { "type" : "angle", "range" : 1, "channel" : 1 },
"sim/joystick/yoke_pitch_ratio" : { "type" : "angle", "range" : 1, "channel" : 2 },
"sim/joystick/yoke_heading_ratio" : { "type" : "angle", "range" : 1, "channel" : 4 },

# assume flaps on channel 5
"sim/cockpit2/controls/flap_ratio" : { "type" : "range", "range" : 1, "channel" : 5 },
# "sim/cockpit2/controls/wingsweep_ratio" : { "type" : "fixed", "value" : 0}, # wings unsweep when deploy (disabled)

# joystick inputs
"axis6" : { "type" : "joyaxis", "channel" : 1, "input_min" : 0.2, "input_max" : 0.8 },
Expand Down
Binary file added ap-31757.core
Binary file not shown.
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_Plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Plane : public Aircraft {
float alpha_stall = 0.4712;
float c_drag_q = 0;
float c_drag_deltae = 0.0;
float c_drag_p = 0.1;
float c_drag_p = 0.0025;
float c_y_0 = 0;
float c_y_b = -0.98;
float c_y_p = 0;
Expand Down

0 comments on commit b6fa556

Please sign in to comment.