56 AINFO <<
"PARK_AND_GO: Don't has lane follow command!";
60 AINFO <<
"PARK_AND_GO: Don't has reference line info or other scenario!";
63 bool park_and_go =
false;
65 const auto vehicle_state_provider =
injector_->vehicle_state();
69 double adc_speed = vehicle_state_provider->linear_velocity();
72 const double max_abs_speed_when_stopped =
73 common::VehicleConfigHelper::Instance()
76 .max_abs_speed_when_stopped();
82 if (
nullptr == routing_end) {
83 AINFO <<
"PARK_AND_GO: Don't has end lane way point!";
88 const auto& reference_line = reference_line_info.reference_line();
89 reference_line.XYToSL(routing_end->pose(), &dest_sl);
90 const double adc_front_edge_s = reference_line_info.AdcSlBoundary().end_s();
92 bool is_ego_on_lane =
false;
93 bool is_lane_type_city_driving =
false;
95 adc_point, 5.0, &lane, &s, &l);
96 if (lane !=
nullptr && lane->IsOnLane({adc_point.x(), adc_point.y()})) {
97 is_ego_on_lane =
true;
99 is_lane_type_city_driving =
true;
103 const double adc_distance_to_dest = dest_sl.
s() - adc_front_edge_s;
104 ADEBUG <<
"adc_distance_to_dest:" << adc_distance_to_dest;
105 bool is_vehicle_static = (std::fabs(adc_speed) < max_abs_speed_when_stopped);
106 bool is_distance_far_enough =
107 (adc_distance_to_dest > scenario_config.min_dist_to_dest());
108 AINFO <<
"PARK_AND_GO: " << is_vehicle_static <<
"," << is_distance_far_enough
109 <<
"," << is_ego_on_lane <<
"," << is_lane_type_city_driving;
112 if (std::fabs(adc_speed) < max_abs_speed_when_stopped &&
113 adc_distance_to_dest > scenario_config.min_dist_to_dest() &&
114 (!is_ego_on_lane || !is_lane_type_city_driving)) {
int GetNearestLaneWithDistance(const apollo::common::PointENU &point, const double distance, LaneInfoConstPtr *nearest_lane, double *nearest_s, double *nearest_l) const
get nearest lane from target point with search radius,
bool IsTransferable(const Scenario *const other_scenario, const Frame &frame) override
Each scenario should define its own transfer condition, i.e., when it should allow to transfer from o...
apollo::planning::ScenarioParkAndGoConfig scenario_config