zero() reset the kalman filter
Esse commit está contido em:
@@ -99,6 +99,16 @@ Controller.prototype.hover = function() {
|
||||
this.go({x: this._state.x, y: this._state.y, z: this._state.z, yaw: this._state.yaw});
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset the kalman filter to its base state (default is x:0, y:0, yaw:0).
|
||||
*
|
||||
* This is especially usefull to set mark the drone position as the starting position
|
||||
* after takeoff.
|
||||
*/
|
||||
Controller.prototype.zero = function() {
|
||||
this._ekf.reset();
|
||||
}
|
||||
|
||||
/*
|
||||
* Move forward (direction faced by the front camera) by the given
|
||||
* distance (in meters).
|
||||
|
||||
@@ -107,5 +107,13 @@ test('Controller', {
|
||||
|
||||
ctrl.left(1, cb);
|
||||
assert(ctrl.right.calledWith(-1, cb));
|
||||
},
|
||||
|
||||
'zero reset the kalman filter': function() {
|
||||
var ctrl = new autonomy.Controller(this.mockClient);
|
||||
sinon.spy(ctrl._ekf, 'reset');
|
||||
|
||||
ctrl.zero();
|
||||
assert(ctrl._ekf.reset.calledOnce);
|
||||
}
|
||||
});
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário