mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
OP-1898 VelocityRoam gets its own MaxRollPitch
This allows smoother velocityroam flight
This commit is contained in:
parent
c272c4d4fc
commit
064a5e831b
@ -113,7 +113,7 @@ void VtolVelocityController::SettingsUpdated(void)
|
||||
|
||||
|
||||
controlNE.UpdatePositionalParameters(vtolPathFollowerSettings->HorizontalPosP);
|
||||
controlNE.UpdateCommandParameters(-vtolPathFollowerSettings->MaxRollPitch, vtolPathFollowerSettings->MaxRollPitch, vtolPathFollowerSettings->VelocityFeedforward);
|
||||
controlNE.UpdateCommandParameters(-vtolPathFollowerSettings->VelocityRoamMaxRollPitch, vtolPathFollowerSettings->VelocityRoamMaxRollPitch, vtolPathFollowerSettings->VelocityFeedforward);
|
||||
}
|
||||
|
||||
int32_t VtolVelocityController::Initialize(VtolPathFollowerSettingsData *ptr_vtolPathFollowerSettings)
|
||||
@ -172,7 +172,7 @@ int8_t VtolVelocityController::UpdateStabilizationDesired(__attribute__((unused)
|
||||
float angle_radians = DEG2RAD(attitudeState.Yaw);
|
||||
float cos_angle = cosf(angle_radians);
|
||||
float sine_angle = sinf(angle_radians);
|
||||
float maxPitch = vtolPathFollowerSettings->MaxRollPitch;
|
||||
float maxPitch = vtolPathFollowerSettings->VelocityRoamMaxRollPitch;
|
||||
stabDesired.StabilizationMode.Pitch = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
|
||||
stabDesired.Pitch = boundf(-northCommand * cos_angle - eastCommand * sine_angle, -maxPitch, maxPitch);
|
||||
stabDesired.StabilizationMode.Roll = STABILIZATIONDESIRED_STABILIZATIONMODE_ATTITUDE;
|
||||
|
@ -18,6 +18,7 @@
|
||||
<field name="EmergencyFallbackAttitude" units="deg" type="float" elementnames="Roll,Pitch" defaultvalue="0,-20.0"/>
|
||||
<field name="EmergencyFallbackYawRate" units="(deg/s)/deg" type="float" elementnames="kP,Max" defaultvalue="2.0, 30.0"/>
|
||||
<field name="MaxRollPitch" units="deg" type="float" elements="1" defaultvalue="25"/>
|
||||
<field name="VelocityRoamMaxRollPitch" units="deg" type="float" elements="1" defaultvalue="20"/>
|
||||
<field name="UpdatePeriod" units="ms" type="uint16" elements="1" defaultvalue="50"/>
|
||||
<field name="BrakeRate" units="m/s2" type="float" elements="1" defaultvalue="2.5"/>
|
||||
<field name="BrakeMaxPitch" units="deg" type="float" elements="1" defaultvalue="25"/>
|
||||
|
Loading…
Reference in New Issue
Block a user