mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 14:33:34 +08:00
Orbit Yaw Vehicle Parameter (#23358)
This commit is contained in:
@@ -90,7 +90,14 @@ bool FlightTaskOrbit::applyCommandParameters(const vehicle_command_s &command, b
|
||||
|
||||
// commanded heading behaviour
|
||||
if (PX4_ISFINITE(command.param3)) {
|
||||
_yaw_behaviour = command.param3;
|
||||
if (static_cast<uint8_t>(command.param3 + .5f) == vehicle_command_s::ORBIT_YAW_BEHAVIOUR_UNCHANGED) {
|
||||
if (!_currently_orbiting) { // only change the yaw behaviour if we are not actively orbiting
|
||||
_yaw_behaviour = _param_mc_orbit_yaw_mod.get();
|
||||
}
|
||||
|
||||
} else {
|
||||
_yaw_behaviour = command.param3;
|
||||
}
|
||||
}
|
||||
|
||||
// save current yaw estimate for ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING
|
||||
@@ -165,6 +172,7 @@ void FlightTaskOrbit::_sanitizeParams(float &radius, float &velocity) const
|
||||
bool FlightTaskOrbit::activate(const trajectory_setpoint_s &last_setpoint)
|
||||
{
|
||||
bool ret = FlightTaskManualAltitude::activate(last_setpoint);
|
||||
_currently_orbiting = false;
|
||||
_orbit_radius = _radius_min;
|
||||
_orbit_velocity = 1.f;
|
||||
_center = _position;
|
||||
@@ -199,6 +207,7 @@ bool FlightTaskOrbit::activate(const trajectory_setpoint_s &last_setpoint)
|
||||
bool FlightTaskOrbit::update()
|
||||
{
|
||||
bool ret = true;
|
||||
_currently_orbiting = true;
|
||||
_updateTrajectoryBoundaries();
|
||||
_adjustParametersByStick();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user