Split EPS_LIN and EPS_ALT
In order to have a different precision requirement on altitude than on horizontal positioning.
Esse commit está contido em:
+6
-5
@@ -5,9 +5,10 @@ var PID = require('./PID');
|
||||
var EKF = require('./EKF');
|
||||
var Camera = require('./Camera');
|
||||
|
||||
EPS_LIN = 0.05; // We are ok with 5 cm precision
|
||||
EPS_ANG = 0.05; // We are ok with 0.05 rad precision (2.5 deg)
|
||||
STABLE_DELAY = 200; // Time in ms to wait before declaring the drone on target
|
||||
EPS_LIN = 0.1; // We are ok with 10 cm horizontal precision
|
||||
EPS_ALT = 0.1; // We are ok with 10 cm altitude precision
|
||||
EPS_ANG = 0.1; // We are ok with 0.1 rad precision (5 deg)
|
||||
STABLE_DELAY = 200; // Time in ms to wait before declaring the drone on target
|
||||
|
||||
module.exports = Controller;
|
||||
util.inherits(Controller, EventEmitter);
|
||||
@@ -216,7 +217,7 @@ Controller.prototype.go = function(goal, callback) {
|
||||
// disable the controller, just in case.
|
||||
this.disable();
|
||||
|
||||
// If no goal given, assume an empty goal (which means the current state as goal)
|
||||
// If no goal given, assume an empty goal
|
||||
goal = goal || {};
|
||||
|
||||
// Normalize the yaw, to make sure we don't spin 360deg for
|
||||
@@ -295,7 +296,7 @@ Controller.prototype._control = function(d) {
|
||||
;
|
||||
|
||||
// Check if we are within the target area
|
||||
if ((Math.abs(ex) < EPS_LIN) && (Math.abs(ey) < EPS_LIN) && (Math.abs(ez) < EPS_LIN) && (Math.abs(eyaw) < EPS_ANG)) {
|
||||
if ((Math.abs(ex) < EPS_LIN) && (Math.abs(ey) < EPS_LIN) && (Math.abs(ez) < EPS_ALT) && (Math.abs(eyaw) < EPS_ANG)) {
|
||||
// Have we been here before ?
|
||||
if (!this._goal.reached && this._last_ok != 0) {
|
||||
// And for long enough ?
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário