geometry_base provides basic implementations for a subset of the interfaces of maliput's geometry API (api::RoadGeometry, etc) that can be shared by most "leaf" backends.
It is suitable for use as base classes for a complete backend implementation, or for mock implementations for unit tests (such as test_utilities/mock_geometry.h).
geometry_base implements all the virtual methods involved in managing the object graph of the road network. It does not implement any of the fundamental geometric methods that define the immersion of lane-frame into Inertial-frame; that is the job of each specific backend. geometry_base's implementation of api::RoadGeometry.
A base implementation for the DoToRoadPosition and DoToFindRoadPosition virtual methods are offered. These methods could be initialize with two different strategies for performing their tasks:
- BruteForceStrategy: This strategy performs a brute force search for the nearest lane on the road network. It performs repetitive queries on the maliput::api::Lane::ToLanePosition method.
- KdTreeStrategy: This strategy performs a search for the nearest lane on the road network using a KdTree. In order to achieve this, the kdtree space needs to initialized, which is done by calling InitializeStrategy() method, after all the lanes have been added to the road geometry.
The InitializeStrategy() method allows you to indicate which strategy you want to use for the search and it is mandatory to call it before using the DoToRoadPosition and DoToFindRoadPosition methods. By default the BruteForceStrategy is used.
road_geometry.AddJunction(...);
road_geometry.AddBranchPoint(...);
|
| | MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (RoadGeometry) |
| |
| | RoadGeometry (const api::RoadGeometryId &id, double linear_tolerance, double angular_tolerance, double scale_length, const math::Vector3 &inertial_to_backend_frame_translation) |
| | Constructs an empty RoadGeometry with the specified tolerances. More...
|
| |
| template<class T > |
| T * | AddJunction (std::unique_ptr< T > junction) |
| | Adds junction to this RoadGeometry. More...
|
| |
| template<class T > |
| T * | AddBranchPoint (std::unique_ptr< T > branch_point) |
| | Adds branch_point to this RoadGeometry. More...
|
| |
| template<class StrategyT = KDTreeStrategy, class... Args> |
| void | InitializeStrategy (Args &&... args) |
| |
| | ~RoadGeometry () override=default |
| |
| RoadGeometryId | id () const |
| | Returns the persistent identifier. More...
|
| |
| int | num_junctions () const |
| | Returns the number of Junctions in the RoadGeometry. More...
|
| |
| const Junction * | junction (int index) const |
| | Returns the Junction indexed by index. More...
|
| |
| int | num_branch_points () const |
| | Returns the number of BranchPoints in the RoadGeometry. More...
|
| |
| const BranchPoint * | branch_point (int index) const |
| | Returns the BranchPoint indexed by index. More...
|
| |
| const IdIndex & | ById () const |
| | Accesses the IdIndex interface, which allows getting elements of the RoadGeometry's object graph by their unique id's. More...
|
| |
| RoadPositionResult | ToRoadPosition (const InertialPosition &inertial_position, const std::optional< RoadPosition > &hint=std::nullopt) const |
| | Determines the RoadPosition corresponding to InertialPosition inertial_position. More...
|
| |
| std::vector< RoadPositionResult > | FindRoadPositions (const InertialPosition &inertial_position, double radius) const |
| | Obtains all RoadPositions within radius of inertial_position. More...
|
| |
| std::vector< RoadPositionResult > | FindSurfaceRoadPositionsAtXY (double x, double y, double radius) const |
| | Finds all RoadPositions within a 2D radius of the given (x, y) inertial coordinates. More...
|
| |
| double | linear_tolerance () const |
| | Returns the tolerance guaranteed for linear measurements (positions). More...
|
| |
| double | angular_tolerance () const |
| | Returns the tolerance guaranteed for angular measurements (orientations). More...
|
| |
| double | scale_length () const |
| | Returns the characteristic scale length expressed by this RoadGeometry. More...
|
| |
| std::vector< std::string > | CheckInvariants () const |
| | Verifies certain invariants guaranteed by the API. More...
|
| |
| std::vector< InertialPosition > | SampleAheadWaypoints (const LaneSRoute &lane_s_route, double path_length_sampling_rate) const |
| | Samples lane_s_route at path_length_sampling_rate and converts those LanePositions into InertialPositions. More...
|
| |
| math::Vector3 | inertial_to_backend_frame_translation () const |
| | The Backend Frame is an inertial frame similar to the Inertial Frame that differ one from another by an isometric transformation. More...
|
| |
| std::string | BackendCustomCommand (const std::string &command) const |
| | This method is meant to provide an extra feature for the backend implementation. More...
|
| |
| std::string | GeoReferenceInfo () const |
| | Returns the Geo Reference info of this RoadGeometry. More...
|
| |