maliput
|
Namespaces | |
graph | |
Classes | |
class | Phase |
Manages a phase in a Route, towards its end. More... | |
struct | PhasePositionResult |
The result of a position query on a Phase. More... | |
class | Route |
Describes the sequence of paths that go from one api::RoadPosition to another. More... | |
struct | RoutePositionResult |
The result of a position query on a Route. More... | |
class | Router |
Computes Routes within an api::RoadNetwork. More... | |
struct | RoutingConstraints |
Holds the constraints that can be applied to the Router when computing a Route. More... | |
Enumerations | |
enum | LaneSRangeRelation { kAdjacentLeft, kAdjacentRight, kLeft, kRight, kSucceedingStraight, kSucceedingLeft, kSucceedingRight, kPrecedingStraight, kPrecedingLeft, kPrecedingRight, kCoincident, kUnrelated, kUnknown } |
Defines the possible relationships the routing API can interpret between two api::LaneSRanges within a Route. More... | |
Functions | |
common::ComparisonResult< PhasePositionResult > | IsPhasePositionResultClose (const PhasePositionResult &ppr_a, const PhasePositionResult &ppr_b, double tolerance) |
Compares equality within tolerance deviation of the PhasePositionResult ppr_a and ppr_b . More... | |
common::ComparisonResult< RoutePositionResult > | IsRoutePositionResultClose (const RoutePositionResult &rpr_a, const RoutePositionResult &rpr_b, double tolerance) |
Compares equality within tolerance deviation of the RoutePositionResult rpr_a and rpr_b . More... | |
std::optional< double > | DetermineEdgeS (const api::Lane &lane, const api::Lane &next_lane) |
Returns the S coordinate in lane that is on the border with next_lane . More... | |
std::vector< api::LaneSRoute > | DeriveLaneSRoutes (const api::RoadPosition &start, const api::RoadPosition &end, double max_length_m) |
Derives and returns a set of LaneSRoute objects that go from start to end . More... | |
std::vector< std::vector< const maliput::api::Lane * > > | FindLaneSequences (const maliput::api::Lane *start, const maliput::api::Lane *end, double max_length_m) |
Finds and returns sequences of lanes that go from a specified start lane to a specified end lane. More... | |
std::vector< std::vector< const maliput::api::Lane * > > | FindLaneSequences (const maliput::api::Lane *start, const maliput::api::Lane *end, double max_length_m, bool no_u_turns) |
Overload to FindLaneSequences() that removes from the result those sequences presenting U-turns when no_u_turns is true. More... | |
std::map< LaneSRangeRelation, const char * > | LaneSRangeRelationMapper () |
std::ostream & | operator<< (std::ostream &os, const LaneSRangeRelation &relation) |
Convenient overload to serialize as string a LaneSRangeRelation. More... | |
bool | ValidatePositionIsInLaneSRanges (const maliput::api::RoadPosition &position, const std::vector< api::LaneSRange > &lane_s_ranges, double tolerance) |
Determines whether the position resides in any of lane_s_ranges . More... | |
void | ValidateRoutingConstraints (const RoutingConstraints &routing_constraints) |
Validates the constraints of each parameter of routing_constraints . More... | |
|
strong |
Defines the possible relationships the routing API can interpret between two api::LaneSRanges within a Route.
Relations described in this enum must be mutually exclusive and comprehensive, i.e., exactly one relation will apply for any given pair of LaneSRange
objects.
The following ASCII art helps to understand the relative relations described below.
x------A>-------x x------B>-------x------E>-------x------H>-------x x------C>-------x------F>-------x------I>-------x x------D>-------x------G>-------x
In the diagram above:
x
indicates the beginning or the end of a api::LaneSRange.>
indicates the direction of travel of the route.Thus,
A
is LaneSRangeRelation::kCoincident with A
.A
is LaneSRangeRelation::kAdjacentLeft of B
.B
is LaneSRangeRelation::kAdjacentRight of A
.A
is LaneSRangeRelation::kLeft of D
.D
is LaneSRangeRelation::kRight of A
.F
is LaneSRangeRelation::kSucceedingStraight of C
.E
and F
are LaneSRangeRelation::kSucceedingLeft of D
.F
and G
are LaneSRangeRelation::kSucceedingRight of B
.E
is LaneSRangeRelation::kPrecedingStraight of H
.E
is LaneSRangeRelation::kPrecedingLeft of I
.F
and G
are LaneSRangeRelation::kPrecedingRight of H
.A
is LaneSRangeRelation::kUnrelated to H
.LaneSRangeRelation::kUnknown represents the case when any of the api::LaneSRanges is not found in the Route.
Enumerator | |
---|---|
kAdjacentLeft | |
kAdjacentRight | |
kLeft | |
kRight | |
kSucceedingStraight | |
kSucceedingLeft | |
kSucceedingRight | |
kPrecedingStraight | |
kPrecedingLeft | |
kPrecedingRight | |
kCoincident | |
kUnrelated | |
kUnknown |
std::vector< api::LaneSRoute > DeriveLaneSRoutes | ( | const api::RoadPosition & | start, |
const api::RoadPosition & | end, | ||
double | max_length_m | ||
) |
Derives and returns a set of LaneSRoute objects that go from start
to end
.
If no routes are found, a vector of length zero is returned. Parameter max_length_m
is the maximum length of the intermediate lanes between start
and end
. See the description of FindLaneSequences() for more details. If start
and end
are the same lane, a route consisting of one lane is returned regardless of max_length_m
.
Returns the S coordinate in lane
that is on the border with next_lane
.
When lane
is not connected to next_lane
, std::nullopt is returned.
std::vector< std::vector< const Lane * > > FindLaneSequences | ( | const maliput::api::Lane * | start, |
const maliput::api::Lane * | end, | ||
double | max_length_m | ||
) |
Finds and returns sequences of lanes that go from a specified start lane to a specified end lane.
Only ongoing lanes are searched (adjacent lanes are not). If start
and end
are the same lane, a sequence of one lane is returned regardless of max_length_m
.
start | The lane at the start of the sequence. |
end | The lane at the end of the sequence. |
max_length_m | The maximum length of a sequence in meters, not including start and end . The lengths of start and end are not included because a vehicle may not fully traverse them. Getting from start to end , however, requires a vehicle to fully traverse all intermediate lanes in the sequence, which is why only the sum of their lengths are included in the comparison with this upper bound. |
start
and the last lane is end
. An empty vector is returned if no sequences are found. std::vector< std::vector< const Lane * > > FindLaneSequences | ( | const maliput::api::Lane * | start, |
const maliput::api::Lane * | end, | ||
double | max_length_m, | ||
bool | no_u_turns | ||
) |
Overload to FindLaneSequences() that removes from the result those sequences presenting U-turns when no_u_turns
is true.
Otherwise, the function behaves exactly the same. In this context, a U-turn is when the route backtracks against itself within the same lane.
common::ComparisonResult< PhasePositionResult > IsPhasePositionResultClose | ( | const PhasePositionResult & | ppr_a, |
const PhasePositionResult & | ppr_b, | ||
double | tolerance | ||
) |
Compares equality within tolerance
deviation of the PhasePositionResult ppr_a
and ppr_b
.
ppr_a | The first PhasePositionResult to compare. |
ppr_b | The second PhasePositionResult to compare. |
tolerance | The tolerance to use for the comparison. |
common::ComparisonResult< RoutePositionResult > IsRoutePositionResultClose | ( | const RoutePositionResult & | rpr_a, |
const RoutePositionResult & | rpr_b, | ||
double | tolerance | ||
) |
Compares equality within tolerance
deviation of the RoutePositionResult rpr_a
and rpr_b
.
rpr_a | The first RoutePositionResult to compare. |
rpr_b | The second RoutePositionResult to compare. |
tolerance | The tolerance to use for the comparison. |
std::map<LaneSRangeRelation, const char*> maliput::routing::LaneSRangeRelationMapper | ( | ) |
std::ostream& maliput::routing::operator<< | ( | std::ostream & | os, |
const LaneSRangeRelation & | relation | ||
) |
Convenient overload to serialize as string a LaneSRangeRelation.
os | A mutable reference to a std::ostream. |
relation | The LaneSRangeRelation to serialize. |
os
with relation
serialized. bool ValidatePositionIsInLaneSRanges | ( | const maliput::api::RoadPosition & | position, |
const std::vector< api::LaneSRange > & | lane_s_ranges, | ||
double | tolerance | ||
) |
Determines whether the position
resides in any of lane_s_ranges
.
tolerance
is used to expand the range of lane_s_ranges
when evaluating position
.
position | The api::RoadPosition to evaluate. It must be valid. |
lane_s_ranges | The api::LaneSRanges. It must not be empty. |
tolerance | Tolerance to compare api::LaneSRanges' ranges with position . It must be non-negative. |
position
is in any of lane_s_ranges
with tolerance
in the LANE-Frame s coordinate. common::assertion_error | When position is not valid. |
common::assertion_error | When lane_s_ranges is empty. |
common::assertion_error | When tolerance is negative. |
void ValidateRoutingConstraints | ( | const RoutingConstraints & | routing_constraints | ) |
Validates the constraints of each parameter of routing_constraints
.
routing_constraints | A RoutingConstraints to validate. |
common::assertion_error | When one of the preconditions of routing_constraints are violated. |