59 if (!planning_command->has_custom_command()) {
67 AERROR <<
"Free Space Command unpack error" << planning_command->DebugString();
71 const auto& vehicle_param = common::VehicleConfigHelper::Instance()->GetConfig().vehicle_param();
73 const double max_adc_stop_speed = vehicle_param.max_abs_speed_when_stopped();
74 if (std::fabs(adc_speed) > max_adc_stop_speed) {
75 AINFO <<
"adc not stopped" << adc_speed;
80 (vehicle_param.front_edge_to_center() - vehicle_param.back_edge_to_center()) / 2.0,
81 (vehicle_param.left_edge_to_center() - vehicle_param.right_edge_to_center()) / 2.0);
83 Vec2d position(end_pose.x(), end_pose.y());
84 Vec2d center(position + vec_to_center.
rotate(end_pose.heading()));
85 Polygon2d end_box(
Box2d(center, end_pose.heading(), vehicle_param.length(), vehicle_param.width()));
90 AERROR <<
"drivable_roi is needed!";
94 std::vector<Vec2d> polygon_points;
95 for (
const auto& point : roi_polygon.point()) {
96 polygon_points.emplace_back(point.x(), point.y());
98 print_curves.
AddPoint(
"free_space_roi", polygon_points);
101 AERROR <<
"drivable_roi should be counter-clockwise!";
106 AERROR <<
"ego box or end box is out of roi";
111 std::vector<Vec2d> polygon_points;
112 for (
const auto& point : roi_polygon.point()) {
113 polygon_points.emplace_back(point.x(), point.y());
115 print_curves.
AddPoint(
"free_space_roi", polygon_points);
118 AERROR <<
"non_drivable_roi should be clockwise!";
123 AERROR <<
"ego box or end box has collision with obs";
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::external_command::FreeSpaceCommand free_space_command
ScenarioFreeSpaceConfig scenario_config