mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 02:53:34 +08:00
change angle parmeter to degrees
This commit is contained in:
@@ -215,7 +215,8 @@ void CollisionPrevention::_calculateConstrainedSetpoint(Vector2f &setpoint,
|
||||
//check if the bin must be considered regarding the given stick input
|
||||
Vector2f bin_direction = {cos(angle), sin(angle)};
|
||||
|
||||
if (setpoint_dir.dot(bin_direction) > 0 && setpoint_dir.dot(bin_direction) > cosf(_param_mpc_col_prev_ang.get())) {
|
||||
if (setpoint_dir.dot(bin_direction) > 0
|
||||
&& setpoint_dir.dot(bin_direction) > cosf(math::radians(_param_mpc_col_prev_ang.get()))) {
|
||||
//calculate max allowed velocity with a P-controller (same gain as in the position controller)
|
||||
float curr_vel_parallel = math::max(0.f, curr_vel.dot(bin_direction));
|
||||
float delay_distance = curr_vel_parallel * _param_mpc_col_prev_dly.get();
|
||||
|
||||
Reference in New Issue
Block a user