void AC_Avoid::adjust_velocity_polygon(float kP, float accel_cmss, Vector2f &desired_vel_cms,
const Vector2f* boundary, uint16_t num_points, bool earth_frame, float margin, float dt, bool stay_inside)
{
…
for (uint16_t i=0; i<num_points; i++)
{
uint16_t j = i+1;
if (j >= num_points)
{
j = 0;
}
//end points of current edge
Vector2f start = boundary[j];
Vector2f end = boundary[i];
if ((AC_Avoid::BehaviourType)_behavior.get() == BEHAVIOR_SLIDE)
{
…
}
the code :Vector2f start = boundary[i]; Vector2f end = boundary[j]; //结束