//创建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_d