From e18683fd42f98b3458caad7fa251a1161b43818b Mon Sep 17 00:00:00 2001 From: lhark Date: Fri, 17 Jun 2016 03:44:30 +0200 Subject: [PATCH] Better control config --- src/control.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/control.cpp b/src/control.cpp index 7ce4e37..242d4c0 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -12,6 +12,8 @@ using namespace std; class Drone_control { public: + constexpr static float MAX_ANG_VEL = 0.3; + ros::NodeHandle n; ros::Publisher pub_cmd; ros::Publisher pub_takeoff; @@ -58,7 +60,7 @@ class Drone_control { int moy = 0; for (const auto& d : decision_acc) moy += d; - twist.angular.z = moy / (float)NB_ACC * 0.3; + twist.angular.z = moy / (float)NB_ACC * MAX_ANG_VEL; } pub_cmd.publish(twist);