maliput

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 laneframe 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:
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.
#include <include/maliput/geometry_base/road_geometry.h>
Public Member Functions  
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  
Public Member Functions inherited from RoadGeometry  
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...  
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...  
Additional Inherited Members  
Protected Member Functions inherited from RoadGeometry  
RoadGeometry ()=default  
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.
id  the ID of the RoadGeometry 
linear_tolerance  the linear tolerance 
angular_tolerance  the angular tolerance 
scale_length  the scale length 
inertial_to_backend_frame_translation  the Inertial Frame to Backend Frame translation vector 
maliput::common::assertion_error  if either linear_tolerance or angular_tolerance or scale_length is nonpositive. 

overridevirtualdefault 
Reimplemented from RoadGeometry.
T* AddBranchPoint  (  std::unique_ptr< T >  branch_point  ) 
Adds branch_point
to this RoadGeometry.
This RoadGeometry will take ownership of branch_point
and will be assigned as its parent.
branch_point
's raw pointer.T  must be derived from geometry_base::BranchPoint. 
std::exception  if branch_point is empty. 
T* AddJunction  (  std::unique_ptr< T >  junction  ) 
Adds junction
to this RoadGeometry.
This RoadGeometry will take ownership of junction
and will be assigned as its parent.
junction
's raw pointer.T  must be derived from geometry_base::Junction. 
std::exception  if junction is empty. 
void InitializeStrategy  (  Args &&...  args  ) 
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN  (  RoadGeometry  ) 