* PositionSetpoint: remove yaw_valid field
* Navigator: set yaw setpoint to NAN for Takeoff
Don't set a yaw setpoint for takeoff, as Navigator doesn't handle the yaw reset.
The yaw setpoint generation is handled by FlightTaskAuto.
* PositionSetpoint.msg: remove disable_weather_vane and instead only use the yaw field
Strictly follow the concept that if the position_setpoint.yaw is set, then
follow it the controller, and otherwise let the controller set it as it
thinks it's best.
* Navigator: remove logic that sets yaw to be accepted in TAKEOFF
No longer needed as during Takeoff we anyway don't set a yaw setpoint.
* PositionSetpoint.msg: remove yawspeed_valid
* PositionSetpoint.msg: remove yawspeed
* Navigator: set yaw setpoint to NAN instead of current
In set_takeoff and set_land_item, as well as for VTOL transition.
The flight tasks then set the yaw corresponding to the current yaw.
* Navigator: change get_yaw_acceptance into a bool
* PositionSetpoint.msg: improve comment for yaw
* MissionBlock: remove unnecessary code from set_vtol_transition_item
* Navigator: clean up calculate_breaking_stop(), set yaw to NAN
* Navigator: set yaw to NAN in variouls places where not specifc setpoint is desired
* Navigator: set yaw to NAN in reset_position_setpoint()
---------
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
Otherwise if is set to Offtrack, which in turn leads to weird behavior.
E.g. when triggering Land while flying fast forward, the vehcile doesn't
descned to the land point it keeps getting a velocity setpoint from the
smoother that pushes it away from the land point.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
When the yaw estimate is converging, the controller makes the drone yaw
in order to follow the current setpoint. This is unintuitive for the
pilot and it is preferable if the drone continues to fly towards the
same physical direction.
A VTOL plane in MC mode has no yaw setpoint during takeoff because of
weather-vane. To align for the front transition, the yaw target jumps
and caused a step in the controller, making it reach saturation.
With this commit, the previous yaw setpoint is set to the current yaw
when no yaw setpoint is sent in order to create a smooth yaw trajectory
starting at the current orientation when yaw target is suddenly finite.
The yawspeed filter also now contains the yaw speed instead of dyaw in
order to prevent chattering due to dt jitter.
- Switching to the first order filter that was previously
only in FlightTaskManualAltitude.
- Moving the scaling of full stick deflection to
radians per second into the class.
- precision landing works incorrectly, target position is not updated during the descent above target
- _prepareLandSetpoints needs to update _land_position continuously
Co-authored-by: kapacheuski <kapacheuski@gmail.com>
Navigator sets the cruise_speed to -1 if the controller shouldn't listen to
it and instead use the default speed (for MC: MPC_XY_CRUISE). This is for
example for RTL the case, where we want to return at the default speed,
independetly of what the mission speed before was.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
- this allows landing gear to retract automatically when doing a takeoff
and the vehicle is considered high enough
Signed-off-by: RomanBapst <bapstroman@gmail.com>
Remove the entire external yaw handler, dynamic memory allocation,
pointer passing logic. Directly instanciate the weather vane instance
in the flight tasks that support it.
Weather vane should only set a yawrate setpoint, but no yaw setpoint.
Setting it to NAN when WV is active makes sure that whatever _yaw_setpoint
is set previously (e.g. through Waypoint) is not used.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Otherwise the setpoint from weather vane is constantly overwritten by it,
even if the yaw stick is not moved.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This fixes the issue when changing the altitude during a goto for
example, where the vehicle was going backwards and upwards to reach the
closest point to the line. Now the vehicle simply goes towards the
target waypoint.
Since the same parameter is used to generate the trajectory and to
saturate the controller, there is no additional space for the output of
the position controller once it is filled with the feedforward, letting
the altitude grow uncontrolled.
To avoid weird cases where the altitude is different enough and
the offtrack state flies to the target altitude instead of the closest
point on the track between the waypoints.
In MPC_YAW_MODE 3 (along trajectory), the flight task is asked to
produce a yaw setpoint. If the previous yaw value was NAN (e.g.: during
early takeoff), the setpoint should then be reset to the current
estimate.