22 static constexpr uint32_t
FLAGS =
34 const bool w0_is_offroad,
35 const bool dest_is_at_right) {
39 if (dest_is_at_right) {
41 if (w1_marks.second !=
nullptr) {
45 if (w0_marks.first !=
nullptr) {
51 if (w1_marks.first !=
nullptr) {
55 if (w0_marks.second !=
nullptr) {
75 if (!w0.has_value() || !w1.has_value()) {
79 if (w0->road_id != w1->road_id || w0->section_id != w1->section_id) {
88 const auto w0_is_offroad =
IsOffRoad(map, origin);
89 const auto w1_is_offroad =
IsOffRoad(map, destination);
91 if (w0_is_offroad && w1_is_offroad) {
96 if ((w0->lane_id == w1->lane_id) && !w0_is_offroad && !w1_is_offroad) {
103 geom::Vector3D dest_vec = (destination - origin).MakeUnitVector(2 * std::numeric_limits<float>::epsilon());
106 const auto dest_is_at_right =
107 (-orig_vec.
x * dest_vec.
y + orig_vec.
y * dest_vec.
x) < 0;
std::map< std::string, unsigned int > road
bool IsJunction(RoadId road_id) const
std::pair< const element::RoadInfoMarkRecord *, const element::RoadInfoMarkRecord * > GetMarkRecord(Waypoint waypoint) const
std::optional< element::Waypoint > GetWaypoint(const geom::Location &location, int32_t lane_type=static_cast< int32_t >(Lane::LaneType::Driving)) const
std::optional< element::Waypoint > GetClosestWaypointOnRoad(const geom::Location &location, int32_t lane_type=static_cast< int32_t >(Lane::LaneType::Driving)) const
========================================================================
geom::Transform ComputeTransform(Waypoint waypoint) const
static std::vector< LaneMarking > Calculate(const Map &map, const geom::Location &origin, const geom::Location &destination)
static constexpr uint32_t FLAGS
static std::vector< LaneMarking > CrossingAtSameSection(const Map &map, const Waypoint *w0, const Waypoint *w1, const bool w0_is_offroad, const bool dest_is_at_right)
Calculate the lane markings that need to be crossed from lane_id_origin to lane_id_destination.
static bool IsOffRoad(const Map &map, const geom::Location &location)
This file contains definitions of common data structures used in traffic manager.