Browse Source

Better control config

master
lhark 10 years ago
parent
commit
e18683fd42
  1. 4
      src/control.cpp

4
src/control.cpp

@ -12,6 +12,8 @@ using namespace std;
class Drone_control { class Drone_control {
public: public:
constexpr static float MAX_ANG_VEL = 0.3;
ros::NodeHandle n; ros::NodeHandle n;
ros::Publisher pub_cmd; ros::Publisher pub_cmd;
ros::Publisher pub_takeoff; ros::Publisher pub_takeoff;
@ -58,7 +60,7 @@ class Drone_control {
int moy = 0; int moy = 0;
for (const auto& d : decision_acc) for (const auto& d : decision_acc)
moy += d; 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); pub_cmd.publish(twist);

Loading…
Cancel
Save