minimum follow target alt of 8 m added, protecting against nan values in pos controller, fixing ci build error

This commit is contained in:
Jimmy Johnson
2016-05-16 15:11:57 -07:00
parent 42e04d4c11
commit 38b4278998
4 changed files with 12 additions and 9 deletions
+1 -4
View File
@@ -45,7 +45,6 @@
#include <stdbool.h>
#include <math.h>
#include <fcntl.h>
#include <float.h>
#include <systemlib/err.h>
@@ -78,8 +77,6 @@ FollowTarget::FollowTarget(Navigator *navigator, const char *name) :
_target_vel.zero();
_target_distance.zero();
_target_position_offset.zero();
_rot_matrix = (_follow_position_matricies[_follow_target_position]);
}
FollowTarget::~FollowTarget()
@@ -97,7 +94,7 @@ void FollowTarget::on_activation()
_follow_offset = _param_tracking_dist.get() < 1.0F ? 1.0F : _param_tracking_dist.get();
_follow_target_position = (FollowTargetPosition) _param_tracking_side.get();
_follow_target_position = _param_tracking_side.get();
if((_follow_target_position > FOLLOW_FROM_LEFT) || (_follow_target_position < FOLLOW_FROM_RIGHT)) {
_follow_target_position = FOLLOW_FROM_BEHIND;
+2 -2
View File
@@ -72,7 +72,7 @@ private:
WAIT_FOR_TARGET_POSITION
};
enum FollowTargetPosition {
enum {
FOLLOW_FROM_RIGHT,
FOLLOW_FROM_BEHIND,
FOLLOW_FROM_FRONT,
@@ -103,7 +103,7 @@ private:
control::BlockParamInt _param_tracking_side;
FollowTargetState _follow_target_state;
FollowTargetPosition _follow_target_position;
int _follow_target_position;
int _follow_target_sub;
float _step_time_in_ms;
+1 -1
View File
@@ -469,7 +469,7 @@ MissionBlock::set_follow_target_item(struct mission_item_s *item, float min_clea
item->lon = target.lon;
item->altitude = _navigator->get_home_position()->alt;
if (min_clearance > 0.0f) {
if (min_clearance > 8.0f) {
item->altitude += min_clearance;
} else {
item->altitude += 8.0f; // if min clearance is bad set it to 8.0 meters (well above the average height of a person)