From 150b5df7cb8852d1305c476140ce51f4a218c9bc Mon Sep 17 00:00:00 2001 From: baumanta Date: Mon, 29 Jul 2019 13:38:00 +0200 Subject: [PATCH] change size of reaction angle --- src/lib/CollisionPrevention/CollisionPrevention.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/CollisionPrevention/CollisionPrevention.cpp b/src/lib/CollisionPrevention/CollisionPrevention.cpp index 575b31696990..cbdde6f62385 100644 --- a/src/lib/CollisionPrevention/CollisionPrevention.cpp +++ b/src/lib/CollisionPrevention/CollisionPrevention.cpp @@ -224,8 +224,8 @@ void CollisionPrevention::_calculateConstrainedSetpoint(Vector2f &setpoint, float vel_setpoint_bin = setpoint.dot(bin_direction); //limit the velocity - //do not react to obstacles more than 70 degree off the given stick input - if (vel_setpoint_bin > 0.94f * setpoint_length && vel_max_bin >= 0) { + //do not react to obstacles more than 45 degree off the given stick input cos(45deg) = 0.71 + if (vel_setpoint_bin > 0.71f * setpoint_length && vel_max_bin >= 0) { vel_max = math::min(vel_max, vel_max_bin); } }