mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 09:16:01 +03:00
Good behaviour in simulator mode
Disabled servo and level trim on simulator mode
This commit is contained in:
parent
78c2060093
commit
3c9844edce
6 changed files with 8 additions and 14 deletions
|
@ -3279,9 +3279,6 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
|
|||
attitude.values.roll = sbufReadU16(src)-1800;
|
||||
attitude.values.pitch = sbufReadU16(src)-1800;
|
||||
attitude.values.yaw = sbufReadU16(src);
|
||||
// posEstimator.est.pos.x = attitude.values.roll;
|
||||
// posEstimator.est.pos.y = attitude.values.pitch;
|
||||
// posEstimator.est.pos.z = gpsSol.llh.alt;
|
||||
|
||||
acc.accADCf[X] = (float)sbufReadU16(src) / 1000 - 32;// / GRAVITY_CMSS;
|
||||
acc.accADCf[Y] = (float)sbufReadU16(src) / 1000 - 32;// / GRAVITY_CMSS;
|
||||
|
@ -3296,12 +3293,6 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
|
|||
DISABLE_STATE(GPS_FIX);
|
||||
}
|
||||
|
||||
// sbufWriteU16(dst, motor[0]);
|
||||
// sbufWriteU16(dst, servo[1]);
|
||||
// sbufWriteU16(dst, servo[2]);
|
||||
// sbufWriteU16(dst, servo[3]);
|
||||
// sbufWriteU16(dst, servo[4]);
|
||||
|
||||
sbufWriteU16(dst, input[INPUT_STABILIZED_ROLL] + 500);
|
||||
sbufWriteU16(dst, input[INPUT_STABILIZED_PITCH] + 500);
|
||||
sbufWriteU16(dst, input[INPUT_STABILIZED_YAW] + 500);
|
||||
|
|
|
@ -312,8 +312,10 @@ void taskUpdateAux(timeUs_t currentTimeUs)
|
|||
{
|
||||
updatePIDCoefficients();
|
||||
dynamicLpfGyroTask();
|
||||
if (! ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
updateFixedWingLevelTrim(currentTimeUs);
|
||||
}
|
||||
}
|
||||
|
||||
void fcTasksInit(void)
|
||||
{
|
||||
|
|
|
@ -2482,7 +2482,7 @@ groups:
|
|||
description: "Vertical descent velocity under nav_land_slowdown_minalt during the RTH landing phase. [cm/s]"
|
||||
default_value: 50
|
||||
field: general.land_minalt_vspd
|
||||
min: 50
|
||||
min: 0
|
||||
max: 500
|
||||
- name: nav_land_maxalt_vspd
|
||||
description: "Vertical descent velocity above nav_land_slowdown_maxalt during the RTH landing phase. [cm/s]"
|
||||
|
|
|
@ -564,6 +564,9 @@ void processContinuousServoAutotrim(const float dT)
|
|||
}
|
||||
|
||||
void processServoAutotrim(const float dT) {
|
||||
if (ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
return;
|
||||
}
|
||||
if (feature(FEATURE_FW_AUTOTRIM)) {
|
||||
processContinuousServoAutotrim(dT);
|
||||
} else {
|
||||
|
|
|
@ -536,6 +536,7 @@ void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStat
|
|||
if (navStateFlags & NAV_CTL_LAND) {
|
||||
// During LAND we do not allow to raise THROTTLE when nose is up to reduce speed
|
||||
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, 0);
|
||||
throttleCorrection = minThrottleCorrection;
|
||||
} else {
|
||||
#endif
|
||||
throttleCorrection = constrain(throttleCorrection, minThrottleCorrection, maxThrottleCorrection);
|
||||
|
|
|
@ -526,9 +526,6 @@ static uint32_t calculateCurrentValidityFlags(timeUs_t currentTimeUs)
|
|||
|
||||
static void estimationPredict(estimationContext_t * ctx)
|
||||
{
|
||||
if (ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
//return; // posEstimator.est.* was set into fc_msp
|
||||
}
|
||||
const float accWeight = navGetAccelerometerWeight();
|
||||
|
||||
/* Prediction step: Z-axis */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue