Apollo 11.0
自动驾驶开放平台
pnc_map_base.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
21#pragma once
22
23#include <list>
24#include <memory>
25#include <vector>
26
27#include "gflags/gflags.h"
28
29#include "modules/common/vehicle_state/proto/vehicle_state.pb.h"
30#include "modules/common_msgs/planning_msgs/planning_command.pb.h"
31#include "modules/common_msgs/routing_msgs/routing.pb.h"
32
34
35namespace apollo {
36namespace planning {
37
38DECLARE_double(look_backward_distance);
39DECLARE_double(look_forward_short_distance);
40DECLARE_double(look_forward_long_distance);
41
48 public:
49 virtual ~PncMapBase() = default;
50
51 virtual bool CanProcess(const planning::PlanningCommand &command) const = 0;
52
53 virtual bool UpdatePlanningCommand(const planning::PlanningCommand &command);
54
55 static double LookForwardDistance(const double velocity);
59 virtual bool GetRouteSegments(
60 const common::VehicleState &vehicle_state,
61 std::list<apollo::hdmap::RouteSegments> *const route_segments) = 0;
62
66 bool IsNewPlanningCommand(const planning::PlanningCommand &command) const;
67
68 static bool IsNewPlanningCommand(
69 const planning::PlanningCommand &prev_command,
70 const planning::PlanningCommand &new_command);
71
72 virtual bool ExtendSegments(
73 const apollo::hdmap::RouteSegments &segments, double start_s,
74 double end_s,
75 apollo::hdmap::RouteSegments *const truncated_segments) const = 0;
76
77 virtual std::vector<routing::LaneWaypoint> FutureRouteWaypoints() const = 0;
82 virtual void GetEndLaneWayPoint(
83 std::shared_ptr<routing::LaneWaypoint> &end_point) const = 0;
88 virtual hdmap::LaneInfoConstPtr GetLaneById(const hdmap::Id &id) const = 0;
89
91 const common::VehicleState &state,
92 apollo::hdmap::LaneWaypoint *waypoint) const = 0;
93
94 virtual double GetDistanceToDestination() const = 0;
96
97 protected:
103
104 private:
110 virtual bool IsValid(const planning::PlanningCommand &command) const = 0;
111};
112
113} // namespace planning
114} // namespace apollo
static double LookForwardDistance(const double velocity)
virtual bool UpdatePlanningCommand(const planning::PlanningCommand &command)
apollo::hdmap::LaneWaypoint adc_waypoint_
The waypoint of the autonomous driving car
virtual void GetEndLaneWayPoint(std::shared_ptr< routing::LaneWaypoint > &end_point) const =0
Get the end point of PlanningCommand.
virtual std::vector< routing::LaneWaypoint > FutureRouteWaypoints() const =0
virtual bool GetRouteSegments(const common::VehicleState &vehicle_state, std::list< apollo::hdmap::RouteSegments > *const route_segments)=0
use heuristic forward length and backward length
planning::PlanningCommand last_command_
bool IsNewPlanningCommand(const planning::PlanningCommand &command) const
Check if the routing is the same as existing one in Map
virtual bool CanProcess(const planning::PlanningCommand &command) const =0
virtual bool GetNearestPointFromRouting(const common::VehicleState &state, apollo::hdmap::LaneWaypoint *waypoint) const =0
virtual bool ExtendSegments(const apollo::hdmap::RouteSegments &segments, double start_s, double end_s, apollo::hdmap::RouteSegments *const truncated_segments) const =0
virtual hdmap::LaneInfoConstPtr GetLaneById(const hdmap::Id &id) const =0
Get the Lane with the given id.
virtual double GetDistanceToDestination() const =0
virtual apollo::hdmap::LaneWaypoint GetAdcWaypoint() const =0
virtual ~PncMapBase()=default
Planning module main class.
std::shared_ptr< const LaneInfo > LaneInfoConstPtr
DECLARE_double(look_backward_distance)
class register implement
Definition arena_queue.h:37