maliput_malidrive
|
Namespaces | |
params | |
rules | |
Classes | |
struct | BuildPolicy |
Policy for use of concurrency while building a RoadGeometry. More... | |
class | DirectionUsageBuilder |
Functor to build a a vector of maliput::api::rules::DirectionUsageRules. More... | |
class | DiscreteValueRuleStateProviderBuilder |
Functor to build a DiscreteValueRuleStateProvider. More... | |
class | LaneTravelDirection |
Hold the travel direction of a lane obtained from parsing a userData XML node. More... | |
struct | MalidriveXodrLaneProperties |
Holds useful XODR Lane properties. More... | |
class | PhaseProviderBuilder |
Functor to build a ManualPhaseProvider. More... | |
class | RangeValueRuleStateProviderBuilder |
Functor to build a RangeValueRuleStateProvider. More... | |
class | RoadCurveFactory |
Concrete RoadCurveFactoryBase implementation. More... | |
class | RoadCurveFactoryBase |
Interface of a helper class to build road curve related objects by MalidriveRoadGeometryBuilder. More... | |
class | RoadGeometryBuilder |
Builder class on top of the xodr::DBManager which should already have loaded the map. More... | |
struct | RoadGeometryConfiguration |
RoadGeometry construction parameters. More... | |
class | RoadNetworkBuilder |
struct | RoadNetworkConfiguration |
Structure to hold file paths for multiple RoadNetwork structures. More... | |
class | RoadRuleBookBuilder |
Functor to build a RoadRulebook. More... | |
class | RoadRuleBookBuilderOldRules |
Functor to build a RoadRulebook. More... | |
class | RuleRegistryBuilder |
Functor to build a RuleRegistry. More... | |
class | SpeedLimitBuilder |
Functor to build a vector of SpeedLimitRules. More... | |
class | UniqueIntegerProvider |
Class to handle the index arithmetic and get always an increasing integer as ID. More... | |
Enumerations | |
enum | XodrConnectionType { kSuccessor = 0, kPredecessor } |
Convenient enumeration to identify which type of connection is needed. More... | |
Functions | |
std::vector< maliput::api::LaneEnd > | SolveLaneEndsForConnectingRoad (const maliput::api::RoadGeometry *rg, const MalidriveXodrLaneProperties &xodr_lane_properties, const std::map< xodr::RoadHeader::Id, xodr::RoadHeader > &road_headers, XodrConnectionType connection_type) |
Searches which LaneEnds connect to xodr_lane_properties.lane in connection_type direction considering the LaneEnd belongs to an external interface with other XODR Roads, not XODR Junctions. More... | |
std::vector< maliput::api::LaneEnd > | SolveLaneEndsForJunction (const maliput::api::RoadGeometry *rg, const MalidriveXodrLaneProperties &xodr_lane_properties, const std::map< xodr::RoadHeader::Id, xodr::RoadHeader > &road_headers, const std::unordered_map< xodr::Junction::Id, xodr::Junction > &junctions, XodrConnectionType connection_type) |
Searches which LaneEnds connect to xodr_lane_properties.lane in connection_type direction considering the LaneEnd belongs to an external interface with a XODR Junction but the XODR Road does not live in a XODR Junction. More... | |
std::vector< maliput::api::LaneEnd > | SolveLaneEndsWithinJunction (const maliput::api::RoadGeometry *rg, const MalidriveXodrLaneProperties &xodr_lane_properties, const std::map< xodr::RoadHeader::Id, xodr::RoadHeader > &road_headers, XodrConnectionType connection_type) |
Searches which LaneEnds connect to xodr_lane_properties.lane in connection_type direction considering the LaneEnd belongs to an external interface. More... | |
std::vector< maliput::api::LaneEnd > | SolveLaneEndsForInnerLaneSection (const maliput::api::RoadGeometry *rg, const maliput::api::LaneEnd &lane_end, const MalidriveXodrLaneProperties &xodr_lane_properties) |
Searches which LaneEnds connect to lane_end considering it belongs to an inner interface. More... | |
bool | is_driveable_lane (const xodr::Lane &xodr_lane) |
Determines whether or not an xodr_lane is driveable by any vehicle. More... | |
bool | AreOnlyNonDrivableLanes (const xodr::RoadHeader &xodr_road) |
Determines whether or not an xodr_road contains only non-drivable lanes. More... | |
std::string | VehicleUsageValueForXodrLane (const xodr::Lane &xodr_lane) |
Determines the vehicle usage rule state value for xodr_lane based on its XODR Lane type. More... | |
std::optional< std::string > | VehicleExclusiveValueForXodrLane (const xodr::Lane &xodr_lane) |
Determines the vehicle exclusive rule state value for xodr_lane based on its XODR Lane type. More... | |
std::vector< rules::XodrSpeedProperties > | GetRoadTypeSpeedPropertiesInRange (const xodr::RoadHeader &xodr_road, double s_track_start, double s_track_end) |
std::vector< rules::XodrSpeedProperties > | GetLaneSpeedProperties (const xodr::Lane &xodr_lane, double s_track_start, double s_track_end) |
const xodr::RoadHeader & | GetXodrRoadFromMalidriveLane (const Lane *lane) |
const xodr::Lane & | GetXodrLaneFromMalidriveLane (const Lane *lane) |
std::string | GetDirectionUsageRuleStateType (const Lane *lane) |
std::vector< rules::XodrSpeedProperties > | GetMaxSpeedLimitFor (const Lane *lane) |
std::pair< std::string, std::optional< std::string > > | VehicleUsageAndExclusiveRuleStateValues (const Lane *lane) |
std::optional< double > | FindLocalMinFromCubicPol (double a, double b, double c, double d) |
Finds the local minimum of the cubic polynomial. More... | |
double | DetermineRoadGeometryLinearTolerance (const xodr::DBManager *xodr_manager) |
Determines the runtime tolerance a RoadGeometry should be set from the characteristics in a XODR map. More... | |
double | DetermineRoadGeometryAngularTolerance (const xodr::DBManager *xodr_manager) |
Determines the runtime angular a RoadGeometry should be set from the characteristics in a XODR map. More... | |
double | DetermineRoadGeometryScaleLength (const xodr::DBManager *xodr_manager, double linear_tolerance, double angular_tolerance) |
Determines the runtime scale length a RoadGeometry should be set from the characteristics in a XODR map. More... | |
maliput::api::BranchPointId | GetBranchPointId (int branch_point_index) |
Returns a BranchPointId whose base string is: {branch_point_index }. More... | |
maliput::api::JunctionId | GetJunctionId (int xodr_track_id, int xodr_lane_section_index) |
Returns a JunctionId whose base string is: {xodr_track_id _xodr_lane_section_index }. More... | |
maliput::api::JunctionId | GetJunctionId (int xodr_junction_id) |
Returns a JunctionId whose base string is: {xodr_junction_id }. More... | |
maliput::api::LaneId | GetLaneId (int xodr_track_id, int xodr_lane_section_index, int xodr_lane_id) |
Returns a LaneId whose base string is: {xodr_track_id _xodr_lane_section_index _xodr_lane_id }. More... | |
maliput::api::SegmentId | GetSegmentId (int xodr_track_id, int xodr_lane_section_index) |
Returns a SegmentId whose base string is: {xodr_track_id _xodr_lane_section_index }. More... | |
maliput::api::rules::SpeedLimitRule::Id | GetSpeedLimitId (const maliput::api::LaneId &lane_id, int speed_limit_index) |
Returns a SpeedLimitRule::Id whose base string is: {lane_id _speed_limit_index }. More... | |
maliput::api::rules::DirectionUsageRule::Id | GetDirectionUsageRuleId (const maliput::api::LaneId &lane_id, int direction_usage_index) |
Returns a DirectionUsageRule::Id whose base string is: {lane_id _direction_usage_index }. More... | |
maliput::api::rules::DirectionUsageRule::State::Id | GetDirectionUsageRuleStateId (const maliput::api::rules::DirectionUsageRule::Id &rule_id) |
Returns a DirectionUsageRule::State::Id whose base string is: {rule_id }. More... | |
maliput::api::rules::Rule::Id | GetRuleIdFrom (const maliput::api::rules::Rule::TypeId &rule_type_id, const maliput::api::LaneId &lane_id) |
Returns a Rule::Id whose base string is: {rule_type_id.string() '/'lane_id.string() }. More... | |
maliput::api::rules::Rule::Id | GetRuleIdFrom (const maliput::api::rules::Rule::TypeId &rule_type_id, const maliput::api::LaneId &lane_id, int index) |
Returns a Rule::Id whose base string is: {rule_type_id.string() '/'lane_id.string() '_'index }. More... | |
RoadGeometryConfiguration::StandardStrictnessPolicy | operator| (const RoadGeometryConfiguration::StandardStrictnessPolicy &first, const RoadGeometryConfiguration::StandardStrictnessPolicy &second) |
RoadGeometryConfiguration::StandardStrictnessPolicy | operator& (const RoadGeometryConfiguration::StandardStrictnessPolicy &first, const RoadGeometryConfiguration::StandardStrictnessPolicy &second) |
std::vector< xodr::Geometry > | SimplifyGeometries (const std::vector< xodr::Geometry > &geometries, const std::vector< xodr::DBManager::XodrGeometriesToSimplify > &geometries_to_simplify) |
Creates a new vector of xodr::Geometry out of geometries by simplifying it following geometries_to_simplify 's actions. More... | |
xodr::ParserConfiguration | XodrParserConfigurationFromRoadGeometryConfiguration (const RoadGeometryConfiguration &rg_config) |
Builds a xodr::ParserConfiguration from a RoadGeometryConfiguration struct. More... | |
Variables | |
static constexpr double | kMinLinearTolerance {1e-3} |
|
strong |
bool AreOnlyNonDrivableLanes | ( | const xodr::RoadHeader & | xodr_road | ) |
Determines whether or not an xodr_road
contains only non-drivable lanes.
is_driveable_lane method is used to determine the driveability of the lanes in the road.
xodr_road | An Xodr RoadHeader whose lanes will be evaluated as drivable or non-drivable. |
xodr_road
only contains non-drivable lanes. double DetermineRoadGeometryAngularTolerance | ( | const xodr::DBManager * | xodr_manager | ) |
Determines the runtime angular a RoadGeometry should be set from the characteristics in a XODR map.
xodr_manager | A pointer to a xodr::DBManager with a XODR map loaded. |
maliput::common::assertion_error | When xodr_manager is nullptr. |
double DetermineRoadGeometryLinearTolerance | ( | const xodr::DBManager * | xodr_manager | ) |
Determines the runtime tolerance a RoadGeometry should be set from the characteristics in a XODR map.
The selection is based on two constraints:
The hard constraint is required because that would make the builder or the RoadGeometry itself to throw because of not meeting the G1 constraint. The soft constraint is desired when the previous cannot be used. However, because synthesized maps might have relatively small road descriptions which are several order of magnitude less than the road dimension the tolerance is saturated between kMinLinearTolerance and constants::kLinearTolerance.
The tolerance assignment is done as follows:
xodr_manager | A pointer to a xodr::DBManager with a XODR map loaded. |
maliput::common::assertion_error | When xodr_manager is nullptr. |
double DetermineRoadGeometryScaleLength | ( | const xodr::DBManager * | xodr_manager, |
double | linear_tolerance, | ||
double | angular_tolerance | ||
) |
Determines the runtime scale length a RoadGeometry should be set from the characteristics in a XODR map.
xodr_manager | A pointer to a xodr::DBManager with a XODR map loaded. |
linear_tolerance | The proposed linear tolerance. It must be positive. |
angular_tolerance | The proposed angular tolerance. It must be positive. |
maliput::common::assertion_error | When xodr_manager is nullptr. |
std::optional< double > FindLocalMinFromCubicPol | ( | double | a, |
double | b, | ||
double | c, | ||
double | d | ||
) |
Finds the local minimum of the cubic polynomial.
\( f(p) = a p^3 + b p^2 + c p + d / p,a,b,c ∈ ℝ \).
Note: 1 - Local minimum is only related to cubic polynomial. So when a = 0 and the parabola is ascending (b > 0) it will return the absolute minimum. 2 - There is no need to know d
coefficient to get the minimum local, but it is asked just for consistency.
a | Cubic coefficient. |
b | Quadratic coefficient. |
c | Linear coefficient. |
d | Constant coefficient. |
maliput::api::BranchPointId GetBranchPointId | ( | int | branch_point_index | ) |
Returns a BranchPointId whose base string is: {branch_point_index
}.
maliput::api::rules::DirectionUsageRule::Id GetDirectionUsageRuleId | ( | const maliput::api::LaneId & | lane_id, |
int | direction_usage_index | ||
) |
Returns a DirectionUsageRule::Id whose base string is: {lane_id
_direction_usage_index
}.
maliput::api::rules::DirectionUsageRule::State::Id GetDirectionUsageRuleStateId | ( | const maliput::api::rules::DirectionUsageRule::Id & | rule_id | ) |
Returns a DirectionUsageRule::State::Id whose base string is: {rule_id
}.
std::string GetDirectionUsageRuleStateType | ( | const Lane * | lane | ) |
lane
. It is one in the string set {"AgainstS", "WithS", "Bidirectional", "Undefined"}
.lane | The Lane to retrieve its direction usage. It must not be nullptr. |
maliput::common::assertion_error | When lane is nullptr. |
maliput::api::JunctionId GetJunctionId | ( | int | xodr_junction_id | ) |
Returns a JunctionId whose base string is: {xodr_junction_id
}.
maliput::api::JunctionId GetJunctionId | ( | int | xodr_track_id, |
int | xodr_lane_section_index | ||
) |
Returns a JunctionId whose base string is: {xodr_track_id
_xodr_lane_section_index
}.
maliput::api::LaneId GetLaneId | ( | int | xodr_track_id, |
int | xodr_lane_section_index, | ||
int | xodr_lane_id | ||
) |
Returns a LaneId whose base string is: {xodr_track_id
_xodr_lane_section_index
_xodr_lane_id
}.
std::vector< rules::XodrSpeedProperties > GetLaneSpeedProperties | ( | const xodr::Lane & | xodr_lane, |
double | s_track_start, | ||
double | s_track_end | ||
) |
xodr_lane
.xodr_lane | Is a xodr::Lane. |
s_track_start | Track s-coordinate that specifies the start of the lane. |
s_track_end | Track s-coordinate that specifies the end of the lane. |
maliput::common::assertion_error | When s_track_start is greater than s_track_end . |
maliput::common::assertion_error | When s_track_start is negative. |
std::vector< rules::XodrSpeedProperties > GetMaxSpeedLimitFor | ( | const Lane * | lane | ) |
lane
. This method attempts to obtain the speed records for the entire lane
's range. The speed records are obtained according the following priorities. 1 - Speed records from the XODR::Lane. 2 - Speed records from the RoadTypes of the Road. 3 - When no speed limit record is provided in a certain range of the lane, a constants::kDefaultMaxSpeedLimit value is provided to fullfil the gap.lane | A Lane to obtain the maximum speed limit for. It must not be nullptr. |
maliput::common::assertion_error | When lane is nullptr. |
std::vector< rules::XodrSpeedProperties > GetRoadTypeSpeedPropertiesInRange | ( | const xodr::RoadHeader & | xodr_road, |
double | s_track_start, | ||
double | s_track_end | ||
) |
xodr_road
for the [s_track_start , s_track_end] range.xodr_road | Is a XODR::RoadHeader. |
s_track_start | Track s-coordinate that specifies the start of the range. |
s_track_end | Track s-coordinate that specifies the end of the range. |
maliput::common::assertion_error | When s_track_start is greater than s_track_end . |
maliput::common::assertion_error | When s_track_start is negative. |
maliput::api::rules::Rule::Id GetRuleIdFrom | ( | const maliput::api::rules::Rule::TypeId & | rule_type_id, |
const maliput::api::LaneId & | lane_id | ||
) |
Returns a Rule::Id whose base string is: {rule_type_id.string()
'/'lane_id.string()
}.
maliput::api::rules::Rule::Id GetRuleIdFrom | ( | const maliput::api::rules::Rule::TypeId & | rule_type_id, |
const maliput::api::LaneId & | lane_id, | ||
int | index | ||
) |
Returns a Rule::Id whose base string is: {rule_type_id.string()
'/'lane_id.string()
'_'index
}.
maliput::api::SegmentId GetSegmentId | ( | int | xodr_track_id, |
int | xodr_lane_section_index | ||
) |
Returns a SegmentId whose base string is: {xodr_track_id
_xodr_lane_section_index
}.
maliput::api::rules::SpeedLimitRule::Id GetSpeedLimitId | ( | const maliput::api::LaneId & | lane_id, |
int | speed_limit_index | ||
) |
Returns a SpeedLimitRule::Id whose base string is: {lane_id
_speed_limit_index
}.
const xodr::Lane & GetXodrLaneFromMalidriveLane | ( | const Lane * | lane | ) |
lane
. lane | The Lane to retrieve its correspondant xodr::Lane. It must not be nullptr. |
maliput::common::assertion_error | When lane is nullptr. |
maliput::common::assertion_error | When the correspondant xodr::Lane cannot be found. |
const xodr::RoadHeader & GetXodrRoadFromMalidriveLane | ( | const Lane * | lane | ) |
lane
. lane | The Lane to retrieve its correspondant xodr::RoadHeader. It must not be nullptr. |
maliput::common::assertion_error | When lane is nullptr. |
maliput::common::assertion_error | When the correspondant xodr::RoadHeader cannot be found. |
bool is_driveable_lane | ( | const xodr::Lane & | xodr_lane | ) |
Determines whether or not an xodr_lane
is driveable by any vehicle.
This includes lanes that OpenDRIVE's Standard marks as driveable for motorized vehicles when the xml attribute in the node is any of the following xodr::Lane::Type:
Note that xodr::Lane::Type::kBiking and xodr::Lane::Type::kSpecial1 are not included but this function also returns true when xodr_lane
s type matches any of them too. xodr::Lane::Type::kBiking is driveable because non motorized vehicles are allowed to drive through. For a full description why xodr::Lane::Type::kSpecial1 is considered, see malidrive#272 and malidrive#273.
This function considers as non-driveable the following list of xodr::Lane::Type:
xodr_lane
is not the TRACK-lane and it is drivable.xodr_lane | An Xodr Lane that will be evaluated as drivable or non-drivable |
maliput::common::assertion_error | When xodr_lane 's type is not a valid type. |
RoadGeometryConfiguration::StandardStrictnessPolicy operator& | ( | const RoadGeometryConfiguration::StandardStrictnessPolicy & | first, |
const RoadGeometryConfiguration::StandardStrictnessPolicy & | second | ||
) |
RoadGeometryConfiguration::StandardStrictnessPolicy operator| | ( | const RoadGeometryConfiguration::StandardStrictnessPolicy & | first, |
const RoadGeometryConfiguration::StandardStrictnessPolicy & | second | ||
) |
std::vector< xodr::Geometry > SimplifyGeometries | ( | const std::vector< xodr::Geometry > & | geometries, |
const std::vector< xodr::DBManager::XodrGeometriesToSimplify > & | geometries_to_simplify | ||
) |
Creates a new vector of xodr::Geometry out of geometries
by simplifying it following geometries_to_simplify
's actions.
geometries | The vector of xodr::Geometry to simplify of the same RoadHeader::Id. |
geometries_to_simplify | Contains disjunct groups of geometry indices with the same xodr::RoadHeader::Id. When it is empty, no action is performed. |
std::vector< maliput::api::LaneEnd > SolveLaneEndsForConnectingRoad | ( | const maliput::api::RoadGeometry * | rg, |
const MalidriveXodrLaneProperties & | xodr_lane_properties, | ||
const std::map< xodr::RoadHeader::Id, xodr::RoadHeader > & | road_headers, | ||
XodrConnectionType | connection_type | ||
) |
Searches which LaneEnds connect to xodr_lane_properties.lane
in connection_type
direction considering the LaneEnd belongs to an external interface with other XODR Roads, not XODR Junctions.
rg | Is the pointer to the RoadGeometry is being built. It must not be nullptr. |
xodr_lane_properties | Contains useful XODR Lane Properties. |
road_headers | RoadHeaders of the XODR Map. |
connection_type | Is the type (successor or predecessor) of link that is solved. |
maliput::common::assertion_error | When rg is nullptr. |
maliput::common::assertion_error | When there isn't a valid RoadLink. |
maliput::common::assertion_error | When there isn't a valid LaneLink. |
std::vector< maliput::api::LaneEnd > SolveLaneEndsForInnerLaneSection | ( | const maliput::api::RoadGeometry * | rg, |
const maliput::api::LaneEnd & | lane_end, | ||
const MalidriveXodrLaneProperties & | xodr_lane_properties | ||
) |
Searches which LaneEnds connect to lane_end
considering it belongs to an inner interface.
rg | is the pointer to the RoadGeometry is being built. It must not be nullptr. |
lane_end | is the LaneEnd to which this method looks for connections. |
xodr_lane_properties | Contains useful XODR Lane Properties. |
maliput::common::assertion_error | When either rg is nullptr. |
std::vector< maliput::api::LaneEnd > SolveLaneEndsForJunction | ( | const maliput::api::RoadGeometry * | rg, |
const MalidriveXodrLaneProperties & | xodr_lane_properties, | ||
const std::map< xodr::RoadHeader::Id, xodr::RoadHeader > & | road_headers, | ||
const std::unordered_map< xodr::Junction::Id, xodr::Junction > & | junctions, | ||
XodrConnectionType | connection_type | ||
) |
Searches which LaneEnds connect to xodr_lane_properties.lane
in connection_type
direction considering the LaneEnd belongs to an external interface with a XODR Junction but the XODR Road does not live in a XODR Junction.
rg | Is the pointer to the RoadGeometry is being built. It must not be nullptr. |
xodr_lane_properties | Contains useful XODR Lane Properties. |
road_headers | RoadHeaders of the XODR Map. |
junctions | Junctions of the XODR Map. |
connection_type | Is the type (successor or predecessor) of link that is solved. |
maliput::common::assertion_error | When either rg is nullptr. |
maliput::common::assertion_error | When there isn't a valid RoadLink. |
maliput::common::assertion_error | When the junction where the road is connected to doesn't exist. |
std::vector< maliput::api::LaneEnd > SolveLaneEndsWithinJunction | ( | const maliput::api::RoadGeometry * | rg, |
const MalidriveXodrLaneProperties & | xodr_lane_properties, | ||
const std::map< xodr::RoadHeader::Id, xodr::RoadHeader > & | road_headers, | ||
XodrConnectionType | connection_type | ||
) |
Searches which LaneEnds connect to xodr_lane_properties.lane
in connection_type
direction considering the LaneEnd belongs to an external interface.
The XODR Road that contains the LaneEnd is assumed to live within an XODR Junction and it could connect to another XODR Road.
rg | Is the pointer to the RoadGeometry is being built. It must not be nullptr. |
xodr_lane_properties | Contains useful XODR Lane Properties. |
road_headers | RoadHeaders of the XODR Map. |
connection_type | Is the type (successor or predecessor) of link that is solved. |
maliput::common::assertion_error | When either rg is nullptr. |
maliput::common::assertion_error | When the RoadLink links to a junction. |
std::optional< std::string > VehicleExclusiveValueForXodrLane | ( | const xodr::Lane & | xodr_lane | ) |
Determines the vehicle exclusive rule state value for xodr_lane
based on its XODR Lane type.
xodr_lane | An XODR Lane. It must not be nullptr. |
xodr_lane
's type is xodr::Lane::Type::kBiking. "MotorizedVehicleOnly" when xodr_lane
's type is xodr::Lane::Type::kMwyEntry or xodr::Lane::Type::kMwyExit. Otherwise, it returns nullopt.maliput::common::assertion_error | When xodr_lane 's type is not a valid type. |
std::pair< std::string, std::optional< std::string > > VehicleUsageAndExclusiveRuleStateValues | ( | const Lane * | lane | ) |
lane
. maliput::common::assertion_error | When lane is nullptr. |
std::string VehicleUsageValueForXodrLane | ( | const xodr::Lane & | xodr_lane | ) |
Determines the vehicle usage rule state value for xodr_lane
based on its XODR Lane type.
xodr_lane | An XODR Lane. It must not be nullptr. |
is_driveable_lane(xodr_lane)
returns true and XODR Lane type is not xodr::Lane::Type::kParking. "Unrestricted" when XODR Lane type is xodr::Lane::Type::kParking or xodr::Lane::Type::kNone. Otherwise, it returns "NonVehicles".maliput::common::assertion_error | When xodr_lane 's type is not a valid type. |
xodr::ParserConfiguration XodrParserConfigurationFromRoadGeometryConfiguration | ( | const RoadGeometryConfiguration & | rg_config | ) |
Builds a xodr::ParserConfiguration from a RoadGeometryConfiguration struct.
rg_config | The RoadGeometryConfiguration struct. |
|
staticconstexpr |