maliput
RoadObjectBook Class Referenceabstract

Detailed Description

Abstract interface for providing access to RoadObjects in a road network.

RoadObjectBook provides methods to query road objects by various criteria such as ID, type, lane association, or proximity to a position. Implementations are provided by specific backends (e.g., maliput_malidrive for OpenDRIVE maps, maliput_osm for OpenStreetMap data).

This follows the same pattern as TrafficLightBook and TrafficSignBook.

#include <include/maliput/api/objects/road_object_book.h>

Inheritance diagram for RoadObjectBook:
[legend]

Public Member Functions

virtual ~RoadObjectBook ()=default
 
std::vector< const RoadObject * > RoadObjects () const
 Returns all RoadObjects in this book. More...
 
const RoadObjectGetRoadObject (const RoadObject::Id &id) const
 Gets the RoadObject with the specified ID. More...
 
std::vector< const RoadObject * > FindByType (RoadObjectType type) const
 Returns all RoadObjects of the specified type. More...
 
std::vector< const RoadObject * > FindByLane (const LaneId &lane_id) const
 Returns all RoadObjects whose related_lanes() includes lane_id. More...
 
std::vector< const RoadObject * > FindInRadius (const InertialPosition &position, double radius) const
 Returns all RoadObjects within a specified radius of an inertial position. More...
 

Protected Member Functions

 RoadObjectBook ()=default
 

Constructor & Destructor Documentation

◆ ~RoadObjectBook()

virtual ~RoadObjectBook ( )
virtualdefault

Reimplemented in RoadObjectBook.

◆ RoadObjectBook()

RoadObjectBook ( )
protecteddefault

Member Function Documentation

◆ FindByLane()

std::vector<const RoadObject*> FindByLane ( const LaneId lane_id) const

Returns all RoadObjects whose related_lanes() includes lane_id.

Parameters
lane_idThe identifier of the lane.
Returns
A vector of pointers to RoadObjects associated with that lane. Empty if none match.

◆ FindByType()

std::vector<const RoadObject*> FindByType ( RoadObjectType  type) const

Returns all RoadObjects of the specified type.

Parameters
typeThe type of road objects to retrieve.
Returns
A vector of pointers to matching RoadObjects. Empty if none match.

◆ FindInRadius()

std::vector<const RoadObject*> FindInRadius ( const InertialPosition position,
double  radius 
) const

Returns all RoadObjects within a specified radius of an inertial position.

This performs a spatial proximity query using the object's position in the inertial frame. Useful for perception-like queries (e.g., "what objects are near this vehicle?").

Parameters
positionThe center position for the search.
radiusThe search radius in meters. Must be non-negative.
Returns
A vector of pointers to RoadObjects within the specified radius. Empty if none are found.

◆ GetRoadObject()

const RoadObject* GetRoadObject ( const RoadObject::Id id) const

Gets the RoadObject with the specified ID.

Parameters
idThe unique identifier of the road object.
Returns
A pointer to the RoadObject, or nullptr if not found.

◆ RoadObjects()

std::vector<const RoadObject*> RoadObjects ( ) const

Returns all RoadObjects in this book.


The documentation for this class was generated from the following file: