Autoware中pure pursuit纯跟踪算法的代码分析(三)

calcCurvature函数详解

calcCurvature函数原型如下:

double PurePursuit::calcCurvature(const geometry_msgs::Point& target) const
{
  double kappa;
  const geometry_msgs::Point pt = calcRelativeCoordinate(target, current_pose_);
  const double denominator = pt.x * pt.x + pt.y * pt.y;
  const double numerator = 2.0 * pt.y;

  if (denominator != 0.0)
  {
    kappa = numerator / denominator;
  }
  else
  {
    kappa = numerator > 0.0 ? KAPPA_MIN_ : -KAPPA_MIN_;
  }

  return kappa;
}

其中calcRelativeCoordinate函数的返回值是目标规划路径点的位置相对于车辆当前位置的相对坐标。calcRelativeCoordinate函数详解见上一篇文章。

原理图如下:
计算曲率

算法参考:
Simple estimation of curvature given two points.

  1. Convert the target point from map frame into the current pose frame,
    so it has a local coorinates of (pt.x, pt.y, pt.z).
  2. If we think it is a cirle with a curvature kappa passing the two points,
    kappa = 2* pt.y / (pt.x* pt.x + pt.y * pt.y). For detailed derivation, please
    refer to “Integrated Mobile Robot Control” by Omead Amidi
    (CMU-RI-TR-90-17, Equation 3.10 on Page 21)

其中两点间的平面距离AB = L,BC = x,AC = y;利用三角形勾股定律可以求出圆弧半径,然后取倒数就可以求出曲率。

——————
2021.12.16
软件园

  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值