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) {
67 if (!w0.has_value() || !w1.has_value()) {
71 if (w0->road_id != w1->road_id || w0->section_id != w1->section_id) {
80 const auto w0_is_offroad =
IsOffRoad(map, origin);
81 const auto w1_is_offroad =
IsOffRoad(map, destination);
83 if (w0_is_offroad && w1_is_offroad) {
88 if ((w0->lane_id == w1->lane_id) && !w0_is_offroad && !w1_is_offroad) {
95 geom::Vector3D dest_vec = (destination - origin).MakeSafeUnitVector(2 * std::numeric_limits<float>::epsilon());
98 const auto dest_is_at_right =
99 (-orig_vec.
x * dest_vec.
y + orig_vec.
y * dest_vec.
x) < 0;
bool IsJunction(RoadId road_id) const
boost::optional< element::Waypoint > GetClosestWaypointOnRoad(const geom::Location &location, int32_t lane_type=static_cast< int32_t >(Lane::LaneType::Driving)) const
========================================================================
boost::optional< element::Waypoint > GetWaypoint(const geom::Location &location, int32_t lane_type=static_cast< int32_t >(Lane::LaneType::Driving)) const
std::pair< const element::RoadInfoMarkRecord *, const element::RoadInfoMarkRecord * > GetMarkRecord(Waypoint waypoint) 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.