mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 18:09:06 +08:00
VelocitySmoothing - (Re)set _state_init every time _state is (re)set
This commit is contained in:
parent
654938f6a1
commit
8490266be8
@ -48,6 +48,8 @@ void VelocitySmoothing::reset(float accel, float vel, float pos)
|
||||
_state.a = accel;
|
||||
_state.v = vel;
|
||||
_state.x = pos;
|
||||
|
||||
_state_init = _state;
|
||||
}
|
||||
|
||||
float VelocitySmoothing::saturateT1ForAccel(float a0, float j_max, float T1, float a_max)
|
||||
|
||||
@ -100,11 +100,11 @@ public:
|
||||
void setMaxVel(float max_vel) { _max_vel = max_vel; }
|
||||
|
||||
float getCurrentJerk() const { return _state.j; }
|
||||
void setCurrentAcceleration(const float accel) { _state.a = accel; }
|
||||
void setCurrentAcceleration(const float accel) { _state.a = _state_init.a = accel; }
|
||||
float getCurrentAcceleration() const { return _state.a; }
|
||||
void setCurrentVelocity(const float vel) { _state.v = vel; }
|
||||
void setCurrentVelocity(const float vel) { _state.v = _state_init.v = vel; }
|
||||
float getCurrentVelocity() const { return _state.v; }
|
||||
void setCurrentPosition(const float pos) { _state.x = pos; }
|
||||
void setCurrentPosition(const float pos) { _state.x = _state_init.x = pos; }
|
||||
float getCurrentPosition() const { return _state.x; }
|
||||
|
||||
float getVelSp() const { return _vel_sp; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user