Autoware-wayPoint_follower解析

//创建waypoint_follower实例

waypoint_follower::PurePursuitNode ppn;

//执行构造函数pure puresuit_core中构造函数

PurePursuitNode::PurePursuitNode()
  : private_nh_("~")
  , pp_()
  , LOOP_RATE_(30)
  , is_waypoint_set_(false)
  , is_pose_set_(false)
  , is_velocity_set_(false)
  , is_config_set_(false)
  , current_linear_velocity_(0)
  , command_linear_velocity_(0)
  , param_flag_(-1)
  , const_lookahead_distance_(4.0)
  , const_velocity_(5.0)
  , lookahead_distance_ratio_(2.0)
  , minimum_lookahead_distance_(6.0)
{
  initForROS();

  // initialize for PurePursuit
  pp_.setLinearInterpolationParameter(is_linear_interpolation_);
}



//运行ros

 ppn.run();


//run函数中的computeLookaheadDistance函数

//最大前向距离为当前速度乘以10

double maximum_lookahead_distance = current_linear_velocity_ * 10;

double ld = current_linear_velocity_ * lookahead_distance_ratio_;

 return ld < minimum_lookahead_distance_ ? minimum_lookahead_distance_
        : ld > maximum_lookahead_distance ? maximum_lookahead_distance
        : ld;


PurePursuit 类解析


函数计算车的曲率

double PurePursuit::calcCurvature(geometry_msgs::Point target) const





你可能感兴趣的:(Autoware-wayPoint_follower解析)