25#include "absl/strings/str_cat.h"
26#include "google/protobuf/text_format.h"
28#include "modules/common_msgs/map_msgs/map_id.pb.h"
49const double kTrajectoryApproximationMaxError = 2.0;
56 return command.has_lane_follow_command();
62 ACHECK(lane) <<
"Invalid lane id: " << waypoint.
id();
69 ACHECK(lane) <<
"Invalid lane id: " << segment.
id();
73void LaneFollowMap::UpdateNextRoutingWaypointIndex(
int cur_index) {
75 next_routing_waypoint_index_ = 0;
78 if (cur_index >=
static_cast<int>(route_indices_.size())) {
79 next_routing_waypoint_index_ = routing_waypoint_index_.size() - 1;
83 while (next_routing_waypoint_index_ != 0 &&
84 next_routing_waypoint_index_ < routing_waypoint_index_.size() &&
85 routing_waypoint_index_[next_routing_waypoint_index_].index >
87 --next_routing_waypoint_index_;
89 while (next_routing_waypoint_index_ != 0 &&
90 next_routing_waypoint_index_ < routing_waypoint_index_.size() &&
91 routing_waypoint_index_[next_routing_waypoint_index_].index ==
94 routing_waypoint_index_[next_routing_waypoint_index_].waypoint.s) {
95 --next_routing_waypoint_index_;
98 while (next_routing_waypoint_index_ < routing_waypoint_index_.size() &&
99 routing_waypoint_index_[next_routing_waypoint_index_].index <
101 ++next_routing_waypoint_index_;
103 while (next_routing_waypoint_index_ < routing_waypoint_index_.size() &&
105 routing_waypoint_index_[next_routing_waypoint_index_].index &&
107 routing_waypoint_index_[next_routing_waypoint_index_].waypoint.s) {
108 ++next_routing_waypoint_index_;
110 if (next_routing_waypoint_index_ >= routing_waypoint_index_.size()) {
111 next_routing_waypoint_index_ = routing_waypoint_index_.size() - 1;
116 const auto &waypoints =
118 return std::vector<routing::LaneWaypoint>(
119 waypoints.begin() + next_routing_waypoint_index_, waypoints.end());
123 std::shared_ptr<routing::LaneWaypoint> &end_point)
const {
129 const auto &routing_request =
131 if (routing_request.waypoint().size() < 1) {
135 end_point = std::make_shared<routing::LaneWaypoint>();
136 end_point->CopyFrom(*(routing_request.waypoint().rbegin()));
140 if (
nullptr == hdmap_) {
151 const int num_road = routing.road_size();
155 if (!routing.has_routing_request() ||
156 routing.routing_request().waypoint_size() < 2) {
157 AERROR <<
"Routing does not have request.";
160 for (
const auto &waypoint : routing.routing_request().waypoint()) {
161 if (!waypoint.has_id() || !waypoint.has_s()) {
162 AERROR <<
"Routing waypoint has no lane_id or s.";
169void LaneFollowMap::UpdateRoutingRange(
int adc_index) {
171 range_lane_ids_.clear();
172 range_start_ = std::max(0, adc_index - 1);
173 range_end_ = range_start_;
174 while (range_end_ <
static_cast<int>(route_indices_.size())) {
175 const auto &lane_id = route_indices_[range_end_].segment.lane->id().id();
176 if (range_lane_ids_.count(lane_id) != 0) {
179 range_lane_ids_.insert(lane_id);
184bool LaneFollowMap::UpdateVehicleState(
const VehicleState &vehicle_state) {
186 AERROR <<
"The routing is invalid when updating vehicle state.";
187 route_segments_lane_ids_.clear();
190 if (!adc_state_.has_x() ||
192 FLAGS_replan_lateral_distance_threshold +
193 FLAGS_replan_longitudinal_distance_threshold)) {
195 next_routing_waypoint_index_ = 0;
196 adc_route_index_ = -1;
197 stop_for_destination_ =
false;
200 adc_state_ = vehicle_state;
202 AERROR <<
"Failed to get waypoint from routing with point: " <<
"("
203 << vehicle_state.
x() <<
", " << vehicle_state.y() <<
", "
204 << vehicle_state.z() <<
").";
205 route_segments_lane_ids_.clear();
209 if (route_index < 0 ||
210 route_index >=
static_cast<int>(route_indices_.size())) {
217 UpdateNextRoutingWaypointIndex(route_index);
218 adc_route_index_ = route_index;
219 UpdateRoutingRange(adc_route_index_);
221 if (routing_waypoint_index_.empty()) {
222 AERROR <<
"No routing waypoint index.";
226 if (next_routing_waypoint_index_ == routing_waypoint_index_.size() - 1) {
227 stop_for_destination_ =
true;
235 AERROR <<
"Command cannot be processed by LaneFollowMap!";
242 range_lane_ids_.clear();
243 route_indices_.clear();
244 all_lane_ids_.clear();
245 route_segments_lane_ids_.clear();
246 for (
int road_index = 0; road_index < routing.road_size(); ++road_index) {
247 const auto &road_segment = routing.road(road_index);
248 for (
int passage_index = 0; passage_index < road_segment.passage_size();
250 const auto &passage = road_segment.passage(passage_index);
251 for (
int lane_index = 0; lane_index < passage.segment_size();
253 all_lane_ids_.insert(passage.segment(lane_index).id());
254 route_indices_.emplace_back();
255 route_indices_.back().segment =
256 ToLaneSegment(passage.segment(lane_index));
257 if (route_indices_.back().segment.lane ==
nullptr) {
258 AERROR <<
"Failed to get lane segment from passage.";
261 route_indices_.back().index = {road_index, passage_index, lane_index};
263 if (road_index == routing.road_size() - 1 &&
264 lane_index == passage.segment_size() - 1 && passage.can_exit()) {
265 dest_lane_segment_ = passage.segment(lane_index);
273 adc_route_index_ = -1;
274 next_routing_waypoint_index_ = 0;
275 UpdateRoutingRange(adc_route_index_);
277 routing_waypoint_index_.clear();
278 const auto &request_waypoints = routing.routing_request().waypoint();
279 if (request_waypoints.empty()) {
280 AERROR <<
"Invalid routing: no request waypoints.";
284 for (
size_t j = 0; j < route_indices_.size(); ++j) {
285 while (i < request_waypoints.size() &&
287 request_waypoints.Get(i))) {
288 routing_waypoint_index_.emplace_back(
290 request_waypoints.Get(i).s()),
296 stop_for_destination_ =
false;
300int LaneFollowMap::SearchForwardWaypointIndex(
302 int i = std::max(start, 0);
303 while (i <
static_cast<int>(route_indices_.size()) &&
311int LaneFollowMap::SearchBackwardWaypointIndex(
312 int start,
const hdmap::LaneWaypoint &waypoint)
const {
313 int i = std::min(
static_cast<int>(route_indices_.size() - 1), start);
315 route_indices_[i].segment, waypoint)) {
321int LaneFollowMap::NextWaypointIndex(
int index)
const {
322 if (index >=
static_cast<int>(route_indices_.size() - 1)) {
323 return static_cast<int>(route_indices_.size()) - 1;
324 }
else if (index < 0) {
331int LaneFollowMap::GetWaypointIndex(
const hdmap::LaneWaypoint &waypoint)
const {
332 int forward_index = SearchForwardWaypointIndex(adc_route_index_, waypoint);
333 if (forward_index >=
static_cast<int>(route_indices_.size())) {
334 return SearchBackwardWaypointIndex(adc_route_index_, waypoint);
336 if (forward_index == adc_route_index_ ||
337 forward_index == adc_route_index_ + 1) {
338 return forward_index;
340 auto backward_index = SearchBackwardWaypointIndex(adc_route_index_, waypoint);
341 if (backward_index < 0) {
342 return forward_index;
345 return (backward_index + 1 == adc_route_index_) ? backward_index
349bool LaneFollowMap::PassageToSegments(routing::Passage passage,
350 hdmap::RouteSegments *segments)
const {
351 CHECK_NOTNULL(segments);
353 for (
const auto &lane : passage.segment()) {
356 AERROR <<
"Failed to find lane: " << lane.id();
359 segments->emplace_back(lane_ptr, std::max(0.0, lane.start_s()),
360 std::min(lane_ptr->total_length(), lane.end_s()));
362 return !segments->empty();
365std::vector<int> LaneFollowMap::GetNeighborPassages(
366 const routing::RoadSegment &road,
int start_passage)
const {
367 CHECK_GE(start_passage, 0);
368 CHECK_LE(start_passage, road.passage_size());
369 std::vector<int> result;
370 const auto &source_passage = road.passage(start_passage);
371 result.emplace_back(start_passage);
375 if (source_passage.can_exit()) {
378 hdmap::RouteSegments source_segments;
379 if (!PassageToSegments(source_passage, &source_segments)) {
380 AERROR <<
"Failed to convert passage to segments";
383 if (next_routing_waypoint_index_ < routing_waypoint_index_.size() &&
384 source_segments.IsWaypointOnSegment(
385 routing_waypoint_index_[next_routing_waypoint_index_].waypoint)) {
386 ADEBUG <<
"Need to pass next waypoint[" << next_routing_waypoint_index_
387 <<
"] before change lane";
390 std::unordered_set<std::string> neighbor_lanes;
392 for (
const auto &segment : source_segments) {
393 for (
const auto &left_id :
394 segment.lane->lane().left_neighbor_forward_lane_id()) {
395 neighbor_lanes.insert(left_id.id());
399 for (
const auto &segment : source_segments) {
400 for (
const auto &right_id :
401 segment.lane->lane().right_neighbor_forward_lane_id()) {
402 neighbor_lanes.insert(right_id.id());
407 for (
int i = 0; i < road.passage_size(); ++i) {
408 if (i == start_passage) {
411 const auto &target_passage = road.passage(i);
412 for (
const auto &segment : target_passage.segment()) {
413 if (neighbor_lanes.count(segment.
id())) {
414 result.emplace_back(i);
422 const VehicleState &vehicle_state,
423 std::list<hdmap::RouteSegments> *
const route_segments) {
424 double look_forward_distance =
426 double look_backward_distance = FLAGS_look_backward_distance;
428 look_forward_distance, route_segments);
432 const VehicleState &vehicle_state,
const double backward_length,
433 const double forward_length,
434 std::list<hdmap::RouteSegments> *
const route_segments) {
435 if (!UpdateVehicleState(vehicle_state)) {
436 AERROR <<
"Failed to update vehicle state in pnc_map.";
442 adc_route_index_ >=
static_cast<int>(route_indices_.size())) {
443 AERROR <<
"Invalid vehicle state in pnc_map, update vehicle state first.";
446 const auto &route_index = route_indices_[adc_route_index_].index;
447 const int road_index = route_index[0];
448 const int passage_index = route_index[1];
451 auto drive_passages = GetNeighborPassages(road, passage_index);
452 for (
const int index : drive_passages) {
453 const auto &passage = road.passage(index);
454 hdmap::RouteSegments segments;
455 if (!PassageToSegments(passage, &segments)) {
456 ADEBUG <<
"Failed to convert passage to lane segments.";
459 const PointENU nearest_point =
460 index == passage_index
464 hdmap::LaneWaypoint segment_waypoint;
465 if (!segments.GetProjection(nearest_point, &sl, &segment_waypoint)) {
466 ADEBUG <<
"Failed to get projection from point: "
467 << nearest_point.ShortDebugString();
470 if (index != passage_index) {
472 ADEBUG <<
"You cannot drive from current waypoint to passage: "
477 route_segments->emplace_back();
478 const auto last_waypoint = segments.LastWaypoint();
480 sl.s() + forward_length, &route_segments->back())) {
481 AERROR <<
"Failed to extend segments with s=" << sl.s()
482 <<
", backward: " << backward_length
483 <<
", forward: " << forward_length;
486 if (route_segments->back().IsWaypointOnSegment(last_waypoint)) {
487 route_segments->back().SetRouteEndWaypoint(last_waypoint);
489 route_segments->back().SetCanExit(passage.can_exit());
490 route_segments->back().SetNextAction(passage.change_lane_type());
491 const std::string route_segment_id = absl::StrCat(road_index,
"_", index);
492 route_segments->back().SetId(route_segment_id);
493 route_segments->back().SetStopForDestination(stop_for_destination_);
494 if (index == passage_index) {
495 route_segments->back().SetIsOnSegment(
true);
497 }
else if (sl.l() > 0) {
503 UpdateRouteSegmentsLaneIds(route_segments);
504 return !route_segments->empty();
509 waypoint->
lane =
nullptr;
510 std::vector<hdmap::LaneInfoConstPtr> lanes;
512 std::vector<hdmap::LaneInfoConstPtr> valid_lanes;
513 for (
auto lane_id : all_lane_ids_) {
516 if (
nullptr != lane) {
517 valid_lanes.emplace_back(lane);
522 std::vector<hdmap::LaneWaypoint> valid_way_points;
523 for (
const auto &lane : valid_lanes) {
524 if (range_lane_ids_.count(lane->id().id()) == 0) {
525 ADEBUG <<
"not in range" << lane->id().id();
528 if (route_segments_lane_ids_.size() > 0 &&
529 route_segments_lane_ids_.count(lane->id().id()) == 0) {
530 ADEBUG <<
"not in last frame route_segments: " << lane->id().id();
536 if (!lane->GetProjection({point.x(), point.y()}, &s, &l)) {
539 ADEBUG << lane->id().id() <<
"," << s <<
"," << l;
541 static constexpr double kEpsilon = 0.5;
542 if (s > (lane->total_length() + kEpsilon) || (s + kEpsilon) < 0.0) {
545 double lane_heading = lane->Heading(s);
552 valid_way_points.emplace_back();
553 auto &last = valid_way_points.back();
557 ADEBUG <<
"distance:" << std::fabs(l);
559 if (valid_way_points.empty()) {
560 AERROR <<
"Failed to find nearest point: " << point.ShortDebugString();
565 int closest_index = -1;
566 double distance = std::numeric_limits<double>::max();
567 double lane_heading = 0.0;
568 double vehicle_heading = state.
heading();
569 for (
size_t i = 0; i < valid_way_points.size(); i++) {
570 lane_heading = valid_way_points[i].lane->Heading(valid_way_points[i].s);
575 if (std::fabs(valid_way_points[i].l) < distance) {
576 distance = std::fabs(valid_way_points[i].l);
580 if (closest_index == -1) {
581 AERROR <<
"Can not find nearest waypoint. vehicle heading:"
582 << vehicle_heading <<
"lane heading:" << lane_heading;
585 waypoint->
lane = valid_way_points[closest_index].lane;
586 waypoint->
s = valid_way_points[closest_index].s;
587 waypoint->
l = valid_way_points[closest_index].l;
593 if (lane->lane().successor_id().empty()) {
596 hdmap::Id preferred_id = lane->lane().successor_id(0);
597 for (
const auto &lane_id : lane->lane().successor_id()) {
598 if (range_lane_ids_.count(lane_id.id()) != 0) {
599 preferred_id = lane_id;
608 if (lane->lane().predecessor_id().empty()) {
612 std::unordered_set<std::string> predecessor_ids;
613 for (
const auto &lane_id : lane->lane().predecessor_id()) {
614 predecessor_ids.insert(lane_id.id());
617 hdmap::Id preferred_id = lane->lane().predecessor_id(0);
618 for (
const auto &route_index : route_indices_) {
619 auto &lane = route_index.segment.lane->
id();
620 if (predecessor_ids.count(lane.id()) != 0) {
629 const common::PointENU &point,
630 double look_backward,
double look_forward,
631 hdmap::RouteSegments *extended_segments) {
633 hdmap::LaneWaypoint waypoint;
634 if (!segments.GetProjection(point, &sl, &waypoint)) {
635 AERROR <<
"point: " << point.ShortDebugString() <<
" is not on segment";
638 return ExtendSegments(segments, sl.s() - look_backward, sl.s() + look_forward,
645 if (segments.empty()) {
646 AERROR <<
"The input segments is empty";
649 CHECK_NOTNULL(truncated_segments);
652 if (start_s >= end_s) {
653 AERROR <<
"start_s(" << start_s <<
" >= end_s(" << end_s <<
")";
656 std::unordered_set<std::string> unique_lanes;
657 static constexpr double kRouteEpsilon = 1e-3;
660 const auto &first_segment = *segments.begin();
661 auto lane = first_segment.lane;
662 double s = first_segment.start_s;
663 double extend_s = -start_s;
664 std::vector<hdmap::LaneSegment> extended_lane_segments;
665 while (extend_s > kRouteEpsilon) {
666 if (s <= kRouteEpsilon) {
667 lane = GetRoutePredecessor(lane);
668 if (lane ==
nullptr ||
669 unique_lanes.find(lane->id().id()) != unique_lanes.end()) {
672 s = lane->total_length();
674 const double length = std::min(s, extend_s);
675 extended_lane_segments.emplace_back(lane, s - length, s);
678 unique_lanes.insert(lane->id().id());
681 truncated_segments->insert(truncated_segments->begin(),
682 extended_lane_segments.rbegin(),
683 extended_lane_segments.rend());
685 bool found_loop =
false;
687 for (
const auto &lane_segment : segments) {
688 const double adjusted_start_s = std::max(
689 start_s - router_s + lane_segment.start_s, lane_segment.start_s);
690 const double adjusted_end_s =
691 std::min(end_s - router_s + lane_segment.start_s, lane_segment.end_s);
692 if (adjusted_start_s < adjusted_end_s) {
693 if (!truncated_segments->empty() &&
694 truncated_segments->back().lane->id().id() ==
695 lane_segment.lane->id().id()) {
696 truncated_segments->back().end_s = adjusted_end_s;
697 }
else if (unique_lanes.find(lane_segment.lane->id().id()) ==
698 unique_lanes.end()) {
699 truncated_segments->emplace_back(lane_segment.lane, adjusted_start_s,
701 unique_lanes.insert(lane_segment.lane->id().id());
707 router_s += (lane_segment.end_s - lane_segment.start_s);
708 if (router_s > end_s) {
717 double last_lane_segment_length =
718 segments.back().end_s - segments.back().start_s;
719 auto last_lane = segments.back().lane;
720 bool last_lane_can_exit =
721 last_lane->id().id() == dest_lane_segment_.
id() &&
725 if (last_lane_can_exit) {
727 std::max(router_s - kRouteEpsilon,
728 router_s - last_lane_segment_length +
729 dest_lane_segment_.
end_s() - dest_lane_segment_.
start_s() +
730 FLAGS_reference_line_endpoint_extend_length);
734 if (router_s < end_s && !truncated_segments->empty()) {
735 auto &back = truncated_segments->back();
736 if (back.lane->total_length() > back.end_s) {
737 double origin_end_s = back.end_s;
739 std::min(back.end_s + end_s - router_s, back.lane->total_length());
740 router_s += back.end_s - origin_end_s;
744 while (router_s < end_s - kRouteEpsilon) {
745 last_lane = GetRouteSuccessor(last_lane);
746 if (last_lane ==
nullptr ||
747 unique_lanes.find(last_lane->id().id()) != unique_lanes.end()) {
751 bool last_lane_can_exit =
752 last_lane->id().id() == dest_lane_segment_.
id() &&
758 if (last_lane_can_exit) {
759 end_s = std::max(router_s + 1.0,
760 router_s + dest_lane_segment_.
end_s() -
762 FLAGS_reference_line_endpoint_extend_length);
765 const double length = std::min(end_s - router_s, last_lane->total_length());
766 truncated_segments->emplace_back(last_lane, 0, length);
767 unique_lanes.insert(last_lane->id().id());
769 AINFO << last_lane->id().id() <<
", add length: " << length <<
", router_s: " << router_s <<
", end_s: " << end_s;
774void LaneFollowMap::AppendLaneToPoints(
776 std::vector<hdmap::MapPathPoint> *
const points) {
777 if (points ==
nullptr || start_s >= end_s) {
780 double accumulate_s = 0.0;
781 for (
size_t i = 0; i < lane->points().size(); ++i) {
782 if (accumulate_s >= start_s && accumulate_s <= end_s) {
783 points->emplace_back(lane->points()[i], lane->headings()[i],
786 if (i < lane->segments().size()) {
787 const auto &segment = lane->segments()[i];
788 const double next_accumulate_s = accumulate_s + segment.length();
789 if (start_s > accumulate_s && start_s < next_accumulate_s) {
790 points->emplace_back(segment.start() + segment.unit_direction() *
791 (start_s - accumulate_s),
793 hdmap::LaneWaypoint(lane, start_s));
795 if (end_s > accumulate_s && end_s < next_accumulate_s) {
796 points->emplace_back(
797 segment.start() + segment.unit_direction() * (end_s - accumulate_s),
798 lane->headings()[i], hdmap::LaneWaypoint(lane, end_s));
800 accumulate_s = next_accumulate_s;
802 if (accumulate_s > end_s) {
808void LaneFollowMap::UpdateRouteSegmentsLaneIds(
809 const std::list<hdmap::RouteSegments> *route_segments) {
810 route_segments_lane_ids_.clear();
811 for (
auto &route_seg : *route_segments) {
812 for (
auto &lane_seg : route_seg) {
813 if (
nullptr == lane_seg.lane) {
816 route_segments_lane_ids_.insert(lane_seg.lane->id().id());
826 if (adc_route_index_ < 0 || adc_route_index_ >= route_indices_.size()) {
827 AERROR <<
"adc_route_index error, can not get distance to destination, "
832 int adc_road_index = route_indices_[adc_route_index_].index[0];
833 int adc_passage_index = route_indices_[adc_route_index_].index[1];
834 int adc_lane_index = route_indices_[adc_route_index_].index[2];
836 bool get_adc_exit_waypoint =
837 routing.road(adc_road_index).passage(adc_passage_index).can_exit();
838 int start_passage_index = adc_passage_index;
839 int start_lane_index = adc_lane_index;
842 double dis_to_destination = 0.0;
844 for (
int road_index = adc_road_index; road_index < routing.road_size();
846 const auto &road_segment = routing.road(road_index);
847 for (
int passage_index = 0; passage_index < road_segment.passage_size();
849 const auto &passage = road_segment.passage(passage_index);
850 if (!passage.can_exit()) {
854 if (!get_adc_exit_waypoint) {
855 get_adc_exit_waypoint =
true;
857 for (
int index = 0; index < passage.segment_size(); ++index) {
862 if (!lane->GetProjection({adc_state_.x(), adc_state_.y()}, &s, &l)) {
865 static constexpr double kEpsilon = 0.5;
866 if (s > (lane->total_length() + kEpsilon) || (s + kEpsilon) < 0.0) {
869 start_passage_index = passage_index;
870 start_lane_index = index;
876 if (get_adc_exit_waypoint) {
877 if (road_index == adc_road_index &&
878 passage_index == start_passage_index) {
879 for (
int lane_index = start_lane_index;
880 lane_index < passage.segment_size(); ++lane_index) {
881 if (lane_index == start_lane_index) {
882 dis_to_destination +=
883 passage.segment(lane_index).end_s() - start_lane_s;
885 dis_to_destination += passage.segment(lane_index).end_s() -
886 passage.segment(lane_index).start_s();
890 for (
int lane_index = 0; lane_index < passage.segment_size();
892 dis_to_destination += passage.segment(lane_index).end_s() -
893 passage.segment(lane_index).start_s();
900 return dis_to_destination;
static PointENU ToPointENU(const double x, const double y, const double z=0)
LaneInfoConstPtr GetLaneById(const Id &id) const
void SetProperties(const RouteSegments &other)
Copy the properties of other segments to current one
static bool WithinLaneSegment(const LaneSegment &lane_segment, const LaneWaypoint &waypoint)
std::vector< routing::LaneWaypoint > FutureRouteWaypoints() const override
apollo::hdmap::LaneWaypoint GetAdcWaypoint() const override
bool GetRouteSegments(const common::VehicleState &vehicle_state, std::list< apollo::hdmap::RouteSegments > *const route_segments) override
use heuristic forward length and backward length
hdmap::LaneInfoConstPtr GetLaneById(const hdmap::Id &id) const override
Get the Lane with the given id.
bool CanProcess(const planning::PlanningCommand &command) const override
bool UpdatePlanningCommand(const planning::PlanningCommand &command) override
double GetDistanceToDestination() const override
void GetEndLaneWayPoint(std::shared_ptr< routing::LaneWaypoint > &end_point) const override
Get the end point of PlanningCommand.
bool ExtendSegments(const apollo::hdmap::RouteSegments &segments, double start_s, double end_s, apollo::hdmap::RouteSegments *const truncated_segments) const override
bool GetNearestPointFromRouting(const common::VehicleState &state, apollo::hdmap::LaneWaypoint *waypoint) const override
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
planning::PlanningCommand last_command_
Planning module main class.
double AngleDiff(const double from, const double to)
Calculate the difference between angle from and to
double DistanceXY(const U &u, const V &v)
calculate the distance beteween Point u and Point v, which are all have member function x() and y() i...
apollo::hdmap::Id MakeMapId(const std::string &id)
create a Map ID given a string.
std::shared_ptr< const LaneInfo > LaneInfoConstPtr
Some string util functions.
std::string DebugString() const
optional apollo::routing::RoutingResponse lane_follow_command
repeated apollo::routing::LaneWaypoint waypoint
optional RoutingRequest routing_request
repeated apollo::routing::RoadSegment road