mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-28 18:54:06 +08:00
mc_pos_control: gradual vel fix for slope
This commit is contained in:
parent
20a47a1a72
commit
be500723cd
@ -923,7 +923,7 @@ MulticopterPositionControl::limit_vel_xy_gradually()
|
||||
* with x= (curr_sp - pos) and y = _vel_sp with min limit of 0.01
|
||||
*/
|
||||
math::Vector<3> dist = _curr_pos_sp - _pos;
|
||||
float slope = get_cruising_speed_xy() / _target_threshold_xy.get();
|
||||
float slope = (get_cruising_speed_xy() - 0.01f) / _target_threshold_xy.get();
|
||||
float vel_limit = slope * sqrtf(dist(0) * dist(0) + dist(1) * dist(1)) + 0.01f;
|
||||
float vel_mag_xy = sqrtf(_vel_sp(0) * _vel_sp(0) + _vel_sp(1) * _vel_sp(1));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user