ObstacleAvoidance: remove printf and remove unnecessary new lines

This commit is contained in:
Martina Rivizzigno
2019-04-04 16:41:26 +02:00
committed by bresch
parent c1258931da
commit 4dcc77b822
5 changed files with 1 additions and 9 deletions
@@ -235,8 +235,6 @@ bool FlightTaskAuto::_evaluateTriplets()
State previous_state = _current_state;
_current_state = _getCurrentState();
if (triplet_update || (_current_state != previous_state)) {
_updateInternalWaypoints();
_mission_gear = _sub_triplet_setpoint->get().current.landing_gear;
@@ -47,7 +47,6 @@
#include <lib/ecl/geo/geo.h>
#include "lib/FlightTasks/tasks/Utility/ObstacleAvoidance.hpp"
/**
* This enum has to agree with position_setpoint_s type definition
* The only reason for not using the struct position_setpoint is because
@@ -114,8 +113,6 @@ protected:
(ParamInt<px4::params::COM_OBS_AVOID>) _param_com_obs_avoid // obstacle avoidance active
);
private:
matrix::Vector2f _lock_position_xy{NAN, NAN}; /**< if no valid triplet is received, lock positition to current position */
bool _yaw_lock = false; /**< if within acceptance radius, lock yaw to current yaw */
@@ -40,8 +40,6 @@
using namespace matrix;
bool FlightTaskAutoMapper2::activate()
{
bool ret = FlightTaskAuto::activate();
@@ -80,5 +80,4 @@ private:
void _reset(); /**< Resets member variables to current vehicle state */
WaypointType _type_previous{WaypointType::idle}; /**< Previous type of current target triplet. */
bool _highEnoughForLandingGear(); /**< Checks if gears can be lowered. */
};
@@ -155,7 +155,7 @@ void ObstacleAvoidance::checkAvoidanceProgress(const Vector3f &pos, const Vector
// vector from previous triplet to current target
Vector2f prev_to_target = Vector2f(_curr_wp - prev_wp);
// vector from previous triplet to the vehicle projected position on the line previous-target triplet
Vector2f prev_to_closest_pt = closest_pt - Vector2f(prev_wp); prev_to_closest_pt.print();
Vector2f prev_to_closest_pt = closest_pt - Vector2f(prev_wp);
// fraction of the previous-tagerget line that has been flown
const float prev_curr_travelled = prev_to_closest_pt.length() / prev_to_target.length();