mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-03 22:48:28 -04:00
AC_Avoidance: add adjust_velocity that accepts Vector3f for convenience
We should actually modify this function to scale back the z axis in order to avoid breaching the vertical fence. Currently breaching the vertical fence is handled within the position controller which is inconsistent.
This commit is contained in:
parent
692ff22453
commit
f27cf8d388
@ -37,6 +37,15 @@ void AC_Avoid::adjust_velocity(const float kP, const float accel_cmss, Vector2f
|
||||
}
|
||||
}
|
||||
|
||||
// convenience function to accept Vector3f. Only x and y are adjusted
|
||||
void AC_Avoid::adjust_velocity(const float kP, const float accel_cmss, Vector3f &desired_vel)
|
||||
{
|
||||
Vector2f des_vel_xy(desired_vel.x, desired_vel.y);
|
||||
adjust_velocity(kP, accel_cmss, des_vel_xy);
|
||||
desired_vel.x = des_vel_xy.x;
|
||||
desired_vel.y = des_vel_xy.y;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adjusts the desired velocity for the circular fence.
|
||||
*/
|
||||
|
@ -27,8 +27,10 @@ public:
|
||||
/*
|
||||
* Adjusts the desired velocity so that the vehicle can stop
|
||||
* before the fence/object.
|
||||
* Note: Vector3f version is for convenience and only adjusts x and y axis
|
||||
*/
|
||||
void adjust_velocity(const float kP, const float accel_cmss, Vector2f &desired_vel);
|
||||
void adjust_velocity(const float kP, const float accel_cmss, Vector3f &desired_vel);
|
||||
|
||||
static const struct AP_Param::GroupInfo var_info[];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user