Skip to content

Commit

Permalink
backport some params to represent a stock SITL aircraft
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Sep 11, 2024
1 parent 1427284 commit fcbf1a7
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 50 deletions.
164 changes: 164 additions & 0 deletions Tools/autotest/models/sa_gd2000_SITL.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
AHRS_EKF_TYPE,10
AHRS_TRIM_X,0
AHRS_TRIM_Y,0
AHRS_TRIM_Z,0
BATT_MONITOR,0
INS_ACC2OFFS_X,0.001
INS_ACC2OFFS_Y,0.001
INS_ACC2OFFS_Z,0.001
INS_ACC2SCAL_X,1.001
INS_ACC2SCAL_Y,1.001
INS_ACC2SCAL_Z,1.001
INS_ACC3_CALTEMP,-300
INS_ACC3_ID,0
INS_ACC3OFFS_X,0
INS_ACC3OFFS_Y,0
INS_ACC3OFFS_Z,0
INS_ACC3SCAL_X,1
INS_ACC3SCAL_Y,1
INS_ACC3SCAL_Z,1
INS_ACCEL_FILTER,20
INS_ACCOFFS_X,0.001
INS_ACCOFFS_Y,0.001
INS_ACCOFFS_Z,0.001
INS_ACCSCAL_X,1.001
INS_ACCSCAL_Y,1.001
INS_ACCSCAL_Z,1.001
INS_ENABLE_MASK,127
INS_FAST_SAMPLE,1
INS_GYR_CAL,0
INS_GYR_ID,2752772
INS_GYR1_CALTEMP,-300
INS_GYR2_CALTEMP,-300
INS_GYR2_ID,2752780
INS_GYR2OFFS_X,0
INS_GYR2OFFS_Y,0
INS_GYR2OFFS_Z,0
INS_GYR3_CALTEMP,-300
INS_GYR3_ID,0
INS_GYR3OFFS_X,0
INS_GYR3OFFS_Y,0
INS_GYR3OFFS_Z,0
INS_GYRO_FILTER,20
INS_GYRO_RATE,0
INS_GYROFFS_X,0
INS_GYROFFS_Y,0
INS_GYROFFS_Z,0
INS_HNTC2_ENABLE,0
INS_HNTCH_ENABLE,0
INS_LOG_BAT_CNT,1024
INS_LOG_BAT_LGCT,32
INS_LOG_BAT_LGIN,20
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0
INS_POS1_X,0
INS_POS1_Y,0
INS_POS1_Z,0
INS_POS2_X,0
INS_POS2_Y,0
INS_POS2_Z,0
INS_POS3_X,0
INS_POS3_Y,0
INS_POS3_Z,0
INS_RAW_LOG_OPT,0
INS_STILL_THRESH,0.1
INS_TCAL_OPTIONS,0
INS_TCAL1_ENABLE,0
INS_TCAL2_ENABLE,0
INS_TCAL3_ENABLE,0
INS_TRIM_OPTION,1
INS_USE,1
INS_USE2,1
INS_USE3,1
LOG_DISARMED,0
PTCH_LIM_MAX_DEG,20
PTCH_LIM_MIN_DEG,-20
PTCH_RATE_D,0.007265
PTCH_RATE_D_FF,0
PTCH_RATE_FF,0.595723
PTCH_RATE_FLTD,12
PTCH_RATE_FLTE,0
PTCH_RATE_FLTT,3
PTCH_RATE_I,0.11
PTCH_RATE_IMAX,0.666
PTCH_RATE_NEF,0
PTCH_RATE_NTF,0
PTCH_RATE_P,0.15
PTCH_RATE_PDMX,0
PTCH_RATE_SMAX,150
PTCH_TRIM_DEG,0
PTCH2SRV_RLL,1
PTCH2SRV_RMAX_DN,90
PTCH2SRV_RMAX_UP,90
PTCH2SRV_TCONST,0.25
RLL_RATE_D,0.01743
RLL_RATE_D_FF,0
RLL_RATE_FF,0.237212
RLL_RATE_FLTD,12
RLL_RATE_FLTE,0
RLL_RATE_FLTT,3
RLL_RATE_I,0.25
RLL_RATE_IMAX,0.666
RLL_RATE_NEF,0
RLL_RATE_NTF,0
RLL_RATE_P,0.3
RLL_RATE_PDMX,0
RLL_RATE_SMAX,150
RLL2SRV_RMAX,90
RLL2SRV_TCONST,0.25
SCALING_SPEED,15
SERVO1_FUNCTION,4
SERVO1_MAX,1900
SERVO1_MIN,1100
SERVO1_REVERSED,0
SERVO1_TRIM,1500
SERVO2_FUNCTION,19
SERVO2_MAX,1900
SERVO2_MIN,1100
SERVO2_REVERSED,0
SERVO2_TRIM,1500
SERVO3_FUNCTION,70
SERVO3_MAX,2000
SERVO3_MIN,1000
SERVO3_REVERSED,0
SERVO3_TRIM,1000
SERVO4_FUNCTION,21
SERVO4_MAX,1900
SERVO4_MIN,1100
SERVO4_REVERSED,0
SERVO4_TRIM,1500
SIM_PIN_MASK,2
SIM_SERVO_SPEED,0.15
TECS_APPR_SMAX,0
TECS_CLMB_MAX,5
TECS_FLARE_HGT,1
TECS_HDEM_TCONST,3
TECS_HGT_OMEGA,3
TECS_INTEG_GAIN,0.1
TECS_LAND_ARSPD,49.17
TECS_LAND_DAMP,0.5
TECS_LAND_IGAIN,0
TECS_LAND_PDAMP,0
TECS_LAND_PMAX,20
TECS_LAND_SINK,1
TECS_LAND_SPDWGT,1
TECS_LAND_SRC,0.2
TECS_LAND_TCONST,5
TECS_LAND_TDAMP,0
TECS_LAND_THR,-1
TECS_OPTIONS,1
TECS_PITCH_MAX,-4
TECS_PITCH_MIN,-16
TECS_PTCH_DAMP,0
TECS_PTCH_FF_K,0
TECS_PTCH_FF_V0,12
TECS_RLL2THR,10
TECS_SINK_MAX,15
TECS_SINK_MIN,10
TECS_SPD_OMEGA,2
TECS_SPDWEIGHT,1
TECS_SYNAIRSPEED,0
TECS_THR_DAMP,0.5
TECS_TIME_CONST,5
TECS_TKOFF_IGAIN,0
TECS_VERT_ACC,7
51 changes: 1 addition & 50 deletions libraries/SITL/SIM_SA_GD2000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ SA_GD2000::SA_GD2000(const char *frame_str) :
Plane(frame_str)
{
AP_Param::load_defaults_file("@ROMFS/models/sa_gd2000.parm", false);
AP_Param::load_defaults_file("@ROMFS/models/sa_gd2000_SITL.parm", false);
AP::sitl()->models.sa_gd2000_ptr = this;
AP_Param::setup_object_defaults(this, var_info);

Expand All @@ -58,56 +59,6 @@ SA_GD2000::SA_GD2000(const char *frame_str) :

coefficient.c_drag_p = 0.05;

// SITL param
AP_Param::set_by_name("SERVO1_FUNCTION",19);
AP_Param::set_by_name("SERVO1_MAX",2000);
AP_Param::set_by_name("SERVO1_MIN",1000);
AP_Param::set_by_name("SERVO1_REVERSED",0);
AP_Param::set_by_name("SERVO1_TRIM",1500);
AP_Param::set_by_name("SERVO2_FUNCTION",4);
AP_Param::set_by_name("SERVO2_MAX",2000);
AP_Param::set_by_name("SERVO2_MIN",1000);
AP_Param::set_by_name("SERVO2_REVERSED",1);
AP_Param::set_by_name("SERVO2_TRIM",1500);
AP_Param::set_by_name("SERVO3_FUNCTION",19);
AP_Param::set_by_name("SERVO3_MAX",2000);
AP_Param::set_by_name("SERVO3_MIN",1000);
AP_Param::set_by_name("SERVO3_REVERSED",1);
AP_Param::set_by_name("SERVO3_TRIM",1500);
AP_Param::set_by_name("SERVO4_FUNCTION",4);
AP_Param::set_by_name("SERVO4_MAX",2000);
AP_Param::set_by_name("SERVO4_MIN",1000);
AP_Param::set_by_name("SERVO4_REVERSED",1);
AP_Param::set_by_name("SERVO4_TRIM",1500);



// xplane and HW param
// SERVO1_FUNCTION,19
// SERVO1_MAX,2000
// SERVO1_MIN,1000
// SERVO1_REVERSED,0
// SERVO1_TRIM,1500
// SERVO2_FUNCTION,4
// SERVO2_MAX,2000
// SERVO2_MIN,1000
// SERVO2_REVERSED,1
// SERVO2_TRIM,1500
// SERVO3_FUNCTION,19
// SERVO3_MAX,2000
// SERVO3_MIN,1000
// SERVO3_REVERSED,1
// SERVO3_TRIM,1500
// SERVO4_FUNCTION,4
// SERVO4_MAX,2000
// SERVO4_MIN,1000
// SERVO4_REVERSED,1
// SERVO4_TRIM,1500





}

/*
Expand Down

0 comments on commit fcbf1a7

Please sign in to comment.