Skip to content

Commit

Permalink
FlightTaskAuto: remove isTargetModified()
Browse files Browse the repository at this point in the history
As it is no longer needed w/o avoidance.

Signed-off-by: Silvan <[email protected]>
  • Loading branch information
sfuhrer committed Jan 10, 2025
1 parent a5edbcc commit 6bdddd4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ bool FlightTaskAuto::update()
_checkEmergencyBraking();
Vector3f waypoints[] = {_prev_wp, _position_setpoint, _next_wp};

if (isTargetModified()) {
// In case object avoidance has injected a new setpoint, we take this as the next waypoints
waypoints[2] = _position_setpoint;
}

const bool should_wait_for_yaw_align = _param_mpc_yaw_mode.get() == int32_t(yaw_mode::towards_waypoint_yaw_first)
&& !_yaw_sp_aligned;
const bool force_zero_velocity_setpoint = should_wait_for_yaw_align || _is_emergency_braking_active;
Expand Down Expand Up @@ -770,15 +765,6 @@ bool FlightTaskAuto::_generateHeadingAlongTraj()
return res;
}

bool FlightTaskAuto::isTargetModified() const
{
const bool xy_modified = (_target - _position_setpoint).xy().longerThan(FLT_EPSILON);
const bool z_valid = PX4_ISFINITE(_position_setpoint(2));
const bool z_modified = z_valid && std::fabs((_target - _position_setpoint)(2)) > FLT_EPSILON;

return xy_modified || z_modified;
}

void FlightTaskAuto::_updateTrajConstraints()
{
// update params of the position smoothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class FlightTaskAuto : public FlightTask

void _checkEmergencyBraking();
bool _generateHeadingAlongTraj(); /**< Generates heading along trajectory. */
bool isTargetModified() const;
void _updateTrajConstraints();

void rcHelpModifyYaw(float &yaw_sp);
Expand Down

0 comments on commit 6bdddd4

Please sign in to comment.