diff --git a/WHATSNEW.txt b/WHATSNEW.txt index 8369ae266..3395d3a19 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -1,4 +1,13 @@ -Release Notes - OpenPilot - Version RELEASE-15.05 RC3 +Release Notes - OpenPilot - Version RELEASE-15.05 RC4 + +RC4 changes relative to RC3: +1. GCS Input flight mode limit fixes hiding unsupported modes. +2. Throttle check on GPSAssist/Stabi whilst in hold removed. Now easy to fly out of hold without reducing throttle. +3. Trialling Rate instead of AxisLock on Yaw during Braking. +4. VelocityRoam now passing throttle position to AltVario. previously it was stuck in AltHold. +5. OP-1905 Fix OPLN in PPM mode blocking telemetry stream of no USB connected + + This release introduces new features and new hardware support for the Revolution Nano. Note that the CC3D is not supported by this feature release. New features for multirotors include: - Fully autonomous flight is now possible with auto-takeoff and landing as flight modes available to path plans. - An all new implementation of altitude vario provides improved altitude maintenance and smoother flight. diff --git a/flight/modules/ManualControl/manualcontrol.c b/flight/modules/ManualControl/manualcontrol.c index 12a6bb61a..56247e836 100644 --- a/flight/modules/ManualControl/manualcontrol.c +++ b/flight/modules/ManualControl/manualcontrol.c @@ -280,7 +280,6 @@ static void manualControlTask(void) // assess throttle state bool throttleNeutral = false; - bool throttleNeutralOrLow = false; float neutralThrustOffset = 0.0f; VtolSelfTuningStatsNeutralThrustOffsetGet(&neutralThrustOffset); @@ -291,9 +290,6 @@ static void manualControlTask(void) if (cmd.Thrust > throttleNeutralLow && cmd.Thrust < throttleNeutralHi) { throttleNeutral = true; } - if (cmd.Thrust < throttleNeutralHi) { - throttleNeutralOrLow = true; - } // determine default thrust mode for hold/brake states uint8_t pathfollowerthrustmode = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL; @@ -371,7 +367,7 @@ static void manualControlTask(void) newAssistedThrottleState != FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL) { // ok auto thrust mode applies in hold unless overridden - if (throttleNeutralOrLow && flagRollPitchHasInput) { + if (flagRollPitchHasInput) { // throttle is neutral approximately and stick input present so revert to primary mode control newAssistedControlState = FLIGHTSTATUS_ASSISTEDCONTROLSTATE_PRIMARY; newAssistedThrottleState = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL; // Effectively None @@ -410,8 +406,13 @@ static void manualControlTask(void) // During development the assistedcontrol implementation is optional and set // set in stabi settings. Once if we decide to always have this on, it can // can be directly set here...i.e. set the flight mode assist as required. - case FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD: case FLIGHTSTATUS_FLIGHTMODE_VELOCITYROAM: + newFlightModeAssist = FLIGHTSTATUS_FLIGHTMODEASSIST_GPSASSIST_PRIMARYTHRUST; + newAssistedThrottleState = FLIGHTSTATUS_ASSISTEDTHROTTLESTATE_MANUAL; + handler = &handler_PATHFOLLOWER; + break; + + case FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD: case FLIGHTSTATUS_FLIGHTMODE_LAND: case FLIGHTSTATUS_FLIGHTMODE_AUTOTAKEOFF: newFlightModeAssist = isAssistedFlightMode(position, newMode, &modeSettings); diff --git a/flight/modules/PathFollower/vtolbrakecontroller.cpp b/flight/modules/PathFollower/vtolbrakecontroller.cpp index ffa492461..271ee907c 100644 --- a/flight/modules/PathFollower/vtolbrakecontroller.cpp +++ b/flight/modules/PathFollower/vtolbrakecontroller.cpp @@ -290,7 +290,7 @@ int8_t VtolBrakeController::UpdateStabilizationDesired(void) ManualControlCommandData manualControl; ManualControlCommandGet(&manualControl); - stabDesired.StabilizationMode.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_AXISLOCK; + stabDesired.StabilizationMode.Yaw = STABILIZATIONDESIRED_STABILIZATIONMODE_RATE; stabDesired.Yaw = stabSettings.MaximumRate.Yaw * manualControl.Yaw; // default thrust mode to cruise control @@ -322,9 +322,9 @@ int8_t VtolBrakeController::UpdateStabilizationDesired(void) thrustMode = settings.Stabilization6Settings.Thrust; break; case FLIGHTSTATUS_FLIGHTMODE_POSITIONHOLD: - // we hard code the "GPS Assisted" PostionHold/Roam to use alt-vario which - // is a more appropriate throttle mode. "GPSAssist" adds braking - // and a better throttle management to the standard Position Hold. + thrustMode = FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ALTITUDEVARIO; + break; + case FLIGHTSTATUS_FLIGHTMODE_VELOCITYROAM: thrustMode = FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ALTITUDEVARIO; break; default: diff --git a/flight/modules/PathFollower/vtolvelocitycontroller.cpp b/flight/modules/PathFollower/vtolvelocitycontroller.cpp index 968d30cfc..30cd02107 100644 --- a/flight/modules/PathFollower/vtolvelocitycontroller.cpp +++ b/flight/modules/PathFollower/vtolvelocitycontroller.cpp @@ -186,6 +186,7 @@ int8_t VtolVelocityController::UpdateStabilizationDesired(__attribute__((unused) // default thrust mode to altvario stabDesired.StabilizationMode.Thrust = STABILIZATIONDESIRED_STABILIZATIONMODE_ALTITUDEVARIO; + stabDesired.Thrust = manualControl.Thrust; StabilizationDesiredSet(&stabDesired); diff --git a/flight/modules/Stabilization/altitudeloop.cpp b/flight/modules/Stabilization/altitudeloop.cpp index dab918ae4..54fdfc8c4 100644 --- a/flight/modules/Stabilization/altitudeloop.cpp +++ b/flight/modules/Stabilization/altitudeloop.cpp @@ -85,6 +85,7 @@ float stabilizationAltitudeHold(float setpoint, ThrustModeType mode, bool reinit controlDown.Activate(); newaltitude = true; // calculate a thrustDemand on reinit only + thrustMode = mode; altitudeHoldTask(); } diff --git a/flight/modules/Stabilization/outerloop.c b/flight/modules/Stabilization/outerloop.c index 1fb2a4061..0517892ff 100644 --- a/flight/modules/Stabilization/outerloop.c +++ b/flight/modules/Stabilization/outerloop.c @@ -104,25 +104,30 @@ static void stabilizationOuterloopTask() float *rateDesiredAxis = &rateDesired.Roll; int t; float dT = PIOS_DELTATIME_GetAverageSeconds(&timeval); + StabilizationStatusOuterLoopOptions newThrustMode = StabilizationStatusOuterLoopToArray(enabled)[STABILIZATIONSTATUS_OUTERLOOP_THRUST]; - bool reinit = (StabilizationStatusOuterLoopToArray(enabled)[STABILIZATIONSTATUS_OUTERLOOP_THRUST] != previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST]); - previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST] = StabilizationStatusOuterLoopToArray(enabled)[STABILIZATIONSTATUS_OUTERLOOP_THRUST]; -#ifdef REVOLUTION - if (reinit && (previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST] == STABILIZATIONSTATUS_OUTERLOOP_ALTITUDE || - previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST] == STABILIZATIONSTATUS_OUTERLOOP_ALTITUDEVARIO)) { - // disable the altvario velocity control loop - stabilizationDisableAltitudeHold(); + bool reinit = (newThrustMode != previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST]); + // Trigger a disable message to the alt hold on reinit to prevent that loop from running when not in use. + if (reinit) { + if (previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST] == STABILIZATIONSTATUS_OUTERLOOP_ALTITUDE || + previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST] == STABILIZATIONSTATUS_OUTERLOOP_ALTITUDEVARIO) { + if (newThrustMode != STABILIZATIONSTATUS_OUTERLOOP_ALTITUDE && newThrustMode != STABILIZATIONSTATUS_OUTERLOOP_ALTITUDEVARIO) { + // disable the altvario velocity control loop + stabilizationDisableAltitudeHold(); + } + } } -#endif /* REVOLUTION */ - switch (StabilizationStatusOuterLoopToArray(enabled)[STABILIZATIONSTATUS_OUTERLOOP_THRUST]) { -#ifdef REVOLUTION + // update previous mode + previous_mode[STABILIZATIONSTATUS_OUTERLOOP_THRUST] = newThrustMode; + + // calculate the thrust desired + switch (newThrustMode) { case STABILIZATIONSTATUS_OUTERLOOP_ALTITUDE: rateDesiredAxis[STABILIZATIONSTATUS_OUTERLOOP_THRUST] = stabilizationAltitudeHold(stabilizationDesiredAxis[STABILIZATIONSTATUS_OUTERLOOP_THRUST], ALTITUDEHOLD, reinit); break; case STABILIZATIONSTATUS_OUTERLOOP_ALTITUDEVARIO: rateDesiredAxis[STABILIZATIONSTATUS_OUTERLOOP_THRUST] = stabilizationAltitudeHold(stabilizationDesiredAxis[STABILIZATIONSTATUS_OUTERLOOP_THRUST], ALTITUDEVARIO, reinit); break; -#endif /* REVOLUTION */ case STABILIZATIONSTATUS_OUTERLOOP_DIRECT: case STABILIZATIONSTATUS_OUTERLOOP_DIRECTWITHLIMITS: default: diff --git a/shared/uavobjectdefinition/flightmodesettings.xml b/shared/uavobjectdefinition/flightmodesettings.xml index 22c6fc8bc..162f96d6c 100644 --- a/shared/uavobjectdefinition/flightmodesettings.xml +++ b/shared/uavobjectdefinition/flightmodesettings.xml @@ -11,10 +11,8 @@ defaultvalue="Attitude,Attitude,AxisLock,Manual" limits="%NE:AltitudeHold:AltitudeVario:CruiseControl; \ %NE:AltitudeHold:AltitudeVario:CruiseControl; \ - %NE:AltitudeHold:AltitudeVario:CruiseControl:Attitude:Rattitude:Acro+:WeakLeveling:VirtualBar; \ - %NE:Rate::RateTrainer:Attitude:AxisLock:WeakLeveling:VirtualBar:Acro+:Rattitude,\ - %0401NE:Rate:RateTrainer:Attitude:AxisLock:WeakLeveling:VirtualBar:Acro+:Rattitude:AltitudeHold:AltitudeVario,\ - %0402NE:Rate:RateTrainer:Attitude:AxisLock:WeakLeveling:VirtualBar:Acro+:Rattitude:AltitudeHold:AltitudeVario;" + %NE:RateTrainer:AltitudeHold:AltitudeVario:CruiseControl:Attitude:Rattitude:Acro+:WeakLeveling:VirtualBar; \ + %NE:Rate:RateTrainer:Attitude:AxisLock:WeakLeveling:VirtualBar:Acro+:Rattitude;" /> @@ -80,30 +68,12 @@ elements="6" options="Manual,Stabilized1,Stabilized2,Stabilized3,Stabilized4,Stabilized5,Stabilized6,PositionHold,CourseLock,VelocityRoam,HomeLeash,AbsolutePosition,ReturnToBase,Land,PathPlanner,POI,AutoCruise,AutoTakeoff" defaultvalue="Stabilized1,Stabilized2,Stabilized3,Stabilized4,Stabilized5,Stabilized6" - limits="\ - %0401NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0402NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0903NE:POI:PathPlanner:AutoCruise;\ - \ - %0401NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0402NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0903NE:POI:PathPlanner:AutoCruise;\ - \ - %0401NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0402NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0903NE:POI:PathPlanner:AutoCruise;\ - \ - %0401NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0402NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0903NE:POI:PathPlanner:AutoCruise;\ - \ - %0401NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0402NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0903NE:POI:PathPlanner:AutoCruise;\ - \ - %0401NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0402NE:PositionHold:CourseLock:VelocityRoam:HomeLeash:AbsolutePosition:ReturnToBase:Land:PathPlanner:POI:AutoCruise:AutoTakeoff\ - %0903NE:POI:PathPlanner:AutoCruise;"/> + limits="%NE:POI:AutoCruise; \ + %NE:POI:AutoCruise; \ + %NE:POI:AutoCruise; \ + %NE:POI:AutoCruise; \ + %NE:POI:AutoCruise; \ + %NE:POI:AutoCruise;" /> diff --git a/shared/uavobjectdefinition/stabilizationsettings.xml b/shared/uavobjectdefinition/stabilizationsettings.xml index 644bfbf41..ca16ccd68 100644 --- a/shared/uavobjectdefinition/stabilizationsettings.xml +++ b/shared/uavobjectdefinition/stabilizationsettings.xml @@ -46,29 +46,7 @@ - +