ad_rss_map_integration
Public Types | Public Member Functions | List of all members
ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE > Class Template Reference

supporting class for implementing the RSS checks More...

#include <ad/rss/map/RssRouteChecker.hpp>

Public Types

typedef std::shared_ptr< RssRouteCheckerPtr
 Smart pointer on RssVehicleAdapter.
 
typedef std::shared_ptr< RssRouteChecker const > ConstPtr
 Smart pointer on constant RssObjectAdapter.
 
using ArtificialObjectInjectionCallbackFunctionType = std::function< RssArtificialObjectAdapterList< OBJECT_INSTANCE_TYPE >(RssRouteCheckerEgoVehicleDataMap< OBJECT_INSTANCE_TYPE > const &egoVehicleMap, RssRouteCheckerVehicleDataMap< OBJECT_INSTANCE_TYPE > const &vehicleMap, RssRouteCheckerPedestrianDataMap< OBJECT_INSTANCE_TYPE > const &pedestrianMap)>
 defines the type for callback to inject artificial objects More...
 
using CalculateTrajectorySetsCallbackFunctionType = std::function< bool(RssRouteCheckerEgoVehicleData< OBJECT_INSTANCE_TYPE > const &egoVehicle, ::ad::rss::map::RssRouteId const &routeId, ::ad::rss::core::RelativeConstellation const &constellation, ::ad::rss::world::ObjectId const &objectId, ::ad::rss::core::RelativeObjectState const &vehicleState, ::ad::geometry::Polygon &brakePolygon, ::ad::geometry::Polygon &continueForwardPolygon)>
 Function callback type for unstructured trajectory set calculation. More...
 

Public Member Functions

 RssRouteChecker (::ad::physics::Duration const dropOutdatedObjecstDuration)
 default constructor
 
virtual ~RssRouteChecker ()=default
 destructor
 
void registerArtificialObjectInjectionCallback (::ad::physics::Distance const artificialObjectSamplingDistance, ArtificialObjectInjectionCallbackFunctionType artificialObjectsInjectionCallback)
 register a callback to inject artificial objects More...
 
void registerCalculateTrajectorySetsCallback (world::ObjectType objectType, CalculateTrajectorySetsCallbackFunctionType calculateTrajectorySetsCallback)
 Register a callback for unstructured trajectory set calculation. More...
 
virtual RssObjectResultList checkObjects (std::chrono::system_clock::time_point const &currentTime, ::ad::physics::Distance const vehicleSamplingDistance, RssEgoVehicleAdapterList< OBJECT_INSTANCE_TYPE > &egoVehicles, RssVehicleAdapterList< OBJECT_INSTANCE_TYPE > &vehicles, ::ad::physics::Distance const pedestrianSamplingDistance, RssPedestrianAdapterList< OBJECT_INSTANCE_TYPE > &pedestrians, typename RssRouteCheckerVehicleData< OBJECT_INSTANCE_TYPE >::RouteExtensionMode routeExtensionMode)
 perform the RSS check of the objects More...
 
bool isEgoVehicleAvailable (::ad::rss::world::ObjectId ego_object_id)
 check if the ego vehicle object is still present. More...
 
bool isEgoVehicleActive (::ad::rss::world::ObjectId ego_object_id)
 check if the ego vehicle object is still present and currently active. More...
 
void restrictOperationToMapArea (::ad::map::lane::LaneIdSet const &lanesToConsider)
 These group of functions restrict the operation of this class to a certain map area. More...
 
bool restrictOperationToMapArea (::ad::map::point::BoundingSphere const &bounding_sphere)
 restriction of the map area to a bounding sphere More...
 
bool restrictOperationToMapArea (std::vector< ad::map::lane::MapAreaPredictionStartPoint > const &predictionStartPoints)
 restriction of the map area to a set of reachable lanes More...
 
bool restrictOperationToIntersectionArea (::ad::map::point::ENUPoint const &intersectionPoint, ::ad::physics::Distance const &intersectionDistance)
 restriction of the map area around an intersection to a set of reachable lanes More...
 
void clearOperationToMapAreaRestriction ()
 clear the restriction to a certain map area More...
 

Protected Member Functions

virtual void objectDataUpdated (RssRouteCheckerEgoVehicleDataMap< OBJECT_INSTANCE_TYPE > &egoVehicleMap)
 callback after object data of the ego vehicles has been updated More...
 
virtual void objectDataUpdated (RssRouteCheckerVehicleDataMap< OBJECT_INSTANCE_TYPE > &vehicleMap)
 callback after object data of the vehicles has been updated
 
virtual void objectDataUpdated (RssRouteCheckerPedestrianDataMap< OBJECT_INSTANCE_TYPE > &pedestrianMap)
 callback after object data of the pedestrians has been updated
 
virtual void objectDataUpdated (RssRouteCheckerArtificialObjectDataMap< OBJECT_INSTANCE_TYPE > &artificialObjectMap)
 callback after object data of the artificial objects has been updated
 
virtual void routesUpdated (RssRouteCheckerEgoVehicleDataMap< OBJECT_INSTANCE_TYPE > &egoVehicleMap)
 callback after the routes of the ego vehicles have been updated
 
virtual void routesUpdated (RssRouteCheckerVehicleDataMap< OBJECT_INSTANCE_TYPE > &vehicleMap)
 callback after the routes of the vehicles have been updated
 
virtual void situationCreated (RssRouteCheckerEgoVehicleData< OBJECT_INSTANCE_TYPE > const &ego_vehicle, RssRouteCheckResult &rssRouteCheckResult)
 callback after the rssRouteCheckResult situations has been created for the respective ego vehicle More...
 
virtual void situationsCreated (RssRouteCheckerEgoVehicleData< OBJECT_INSTANCE_TYPE > const &ego_vehicle, RssObjectResult &rssObjectResult)
 callback after all rssRouteCheckResult situations have been created for the respective ego vehicle More...
 
virtual void situationsCreated (RssObjectResultList &objectResultList)
 callback after all situations for all ego vehicles have been created
 
virtual void checksPerformed (RssObjectResultList &objectResultList)
 callback after all constellations for all ego vehicles have been checked
 

Detailed Description

template<class OBJECT_INSTANCE_TYPE>
class ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >

supporting class for implementing the RSS checks

Member Typedef Documentation

◆ ArtificialObjectInjectionCallbackFunctionType

template<class OBJECT_INSTANCE_TYPE >
using ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::ArtificialObjectInjectionCallbackFunctionType = std::function<RssArtificialObjectAdapterList<OBJECT_INSTANCE_TYPE>( RssRouteCheckerEgoVehicleDataMap<OBJECT_INSTANCE_TYPE> const &egoVehicleMap, RssRouteCheckerVehicleDataMap<OBJECT_INSTANCE_TYPE> const &vehicleMap, RssRouteCheckerPedestrianDataMap<OBJECT_INSTANCE_TYPE> const &pedestrianMap)>

defines the type for callback to inject artificial objects

The provided parameters to the function can be used to re-use already pre-proccessed data on vehicles and pedestrians at the current point in time.

◆ CalculateTrajectorySetsCallbackFunctionType

template<class OBJECT_INSTANCE_TYPE >
using ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::CalculateTrajectorySetsCallbackFunctionType = std::function<bool(RssRouteCheckerEgoVehicleData<OBJECT_INSTANCE_TYPE> const &egoVehicle, ::ad::rss::map::RssRouteId const &routeId, ::ad::rss::core::RelativeConstellation const &constellation, ::ad::rss::world::ObjectId const &objectId, ::ad::rss::core::RelativeObjectState const &vehicleState, ::ad::geometry::Polygon &brakePolygon, ::ad::geometry::Polygon &continueForwardPolygon)>

Function callback type for unstructured trajectory set calculation.

Parameters
[in]egoVehicleThe ego-vehicle data the calculation is performed for
[in]routedIdThe route id of the ego-vehicle the calculation is performed for
[in]constellationThe relative constellation the calculation is based on
[in]objectIdThe id of the object the calculation is based on (one of the two constellation objects)
[in]vehicleStateThe relative object state of the object the calculation is based on (one of the two constellation vehicle states)
[out]brakePolygonThe calculated brake polygon
[out]continueForwardPolygonThe calculated continue forward polygon
Returns
false if a failure occurred during calculations, true otherwise

Member Function Documentation

◆ checkObjects()

template<class OBJECT_INSTANCE_TYPE >
RssObjectResultList ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::checkObjects ( std::chrono::system_clock::time_point const &  currentTime,
::ad::physics::Distance const  vehicleSamplingDistance,
RssEgoVehicleAdapterList< OBJECT_INSTANCE_TYPE > &  egoVehicles,
RssVehicleAdapterList< OBJECT_INSTANCE_TYPE > &  vehicles,
::ad::physics::Distance const  pedestrianSamplingDistance,
RssPedestrianAdapterList< OBJECT_INSTANCE_TYPE > &  pedestrians,
typename RssRouteCheckerVehicleData< OBJECT_INSTANCE_TYPE >::RouteExtensionMode  routeExtensionMode 
)
virtual

perform the RSS check of the objects

This function performs the following steps:

  • update the object data of egoVehicles, vehicles, pedestrians (i.e. data of RssObjectAdapter class including map matching)
  • update the route data of the egoVehicles and vehicles
  • trigger artificial object injection callback if registered (see also registerArtificialObjectInjectionCallback()) and update
  • keep track of the ::ad::rss::core::RssCheck objects for each route of each ego vehicle (which defines the input situation to be checked; one checker for one situation)
  • create the world model for each situation (each route of each ego vehicle)
  • extract the situation for each situation (each route of each ego vehicle)
  • check the constellation for each situation (each route of each ego vehicle)
  • provide a proper response for each situation (each route of each ego vehicle)

The protected callback functions allow to interact with the calculation process and e.g. allow to override intermediate results.

Returns
a RSS result list of all considered egoVehicles, vehicles, pedestrians and artificialObjects within this calculations

◆ clearOperationToMapAreaRestriction()

template<class OBJECT_INSTANCE_TYPE >
void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::clearOperationToMapAreaRestriction

clear the restriction to a certain map area

This function clears the lanes to consider for all map operations.

◆ isEgoVehicleActive()

template<class OBJECT_INSTANCE_TYPE >
bool ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::isEgoVehicleActive ( ::ad::rss::world::ObjectId  ego_object_id)
inline

check if the ego vehicle object is still present and currently active.

Check if the ego vehicle is available and still listed as active. The vehicles are active if they have been part of the latest check.

◆ isEgoVehicleAvailable()

template<class OBJECT_INSTANCE_TYPE >
bool ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::isEgoVehicleAvailable ( ::ad::rss::world::ObjectId  ego_object_id)
inline

check if the ego vehicle object is still present.

ego vehicles are dropped from the internal list if there is not update on it for longer than the constructor parameter dropOutdatedObjecstDuration.

◆ objectDataUpdated()

template<class OBJECT_INSTANCE_TYPE >
virtual void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::objectDataUpdated ( RssRouteCheckerEgoVehicleDataMap< OBJECT_INSTANCE_TYPE > &  egoVehicleMap)
inlineprotectedvirtual

callback after object data of the ego vehicles has been updated

Callback functions called after the respective functionality is processed

The following set of callback functions are intentionally non const to allow derived classes to adapt intermediate results. Depending on the research activities conducted, this might be useful to quickly log and/or test out the effects of smaller changes to the complete proceessing chain.

◆ registerArtificialObjectInjectionCallback()

template<class OBJECT_INSTANCE_TYPE >
void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::registerArtificialObjectInjectionCallback ( ::ad::physics::Distance const  artificialObjectSamplingDistance,
ArtificialObjectInjectionCallbackFunctionType  artificialObjectsInjectionCallback 
)

register a callback to inject artificial objects

This function allows to register a callback to inject artificial objects into the procssing of the checkObjects() function. The callback is triggered after the object and route data of the vehicles and pedestrians is updated to allow the injection function the reuse of already available data like map matched positions and future routes.

Parameters
[in]artificialObjectSamplingDistancethe sampling distance used for map matching of artificial objects (see ad::map::match::AdMapMatching::getMapMatchedBoundingBox() for a detailed description of this
[in]artificialObjectsInjectionCallbackthe actual callback function to register (use nullptr to unregister)

◆ registerCalculateTrajectorySetsCallback()

template<class OBJECT_INSTANCE_TYPE >
void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::registerCalculateTrajectorySetsCallback ( world::ObjectType  objectType,
CalculateTrajectorySetsCallbackFunctionType  calculateTrajectorySetsCallback 
)

Register a callback for unstructured trajectory set calculation.

Parameters
[in]objectTypeThe object type this trajectory set calculation should be applied
[in]calculateTrajectorySetsCallbackThe actual callback function to perform the trajectory set calculation

◆ restrictOperationToIntersectionArea()

template<class OBJECT_INSTANCE_TYPE >
bool ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::restrictOperationToIntersectionArea ( ::ad::map::point::ENUPoint const &  intersectionPoint,
::ad::physics::Distance const &  intersectionDistance 
)

restriction of the map area around an intersection to a set of reachable lanes

This function collects all reachable lanes from the intersection at the given intersectionPoint to consider for all map operations. Reachable in the sense of all inner intersection lanes plus all entry/exit arms of the intersection until the given intersectionDistance is reached.

Parameters
[in]intersectionPointthe start points used to check for an intersection to be used
[in]intersectionDistancedistance to be used for a directionless prediction from all intersection border points
Returns
true if the map area is filled

◆ restrictOperationToMapArea() [1/3]

template<class OBJECT_INSTANCE_TYPE >
void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::restrictOperationToMapArea ( ::ad::map::lane::LaneIdSet const &  lanesToConsider)

These group of functions restrict the operation of this class to a certain map area.

The computations within this class are heavily depending on the size and complexity of the used ad map. Especially use cases with many ego vehicles suffer from this. On the other hand, the use-cases with many vehicles are often restricted to specific locations on a map with a certain extend.

The following functions provide different means of restricting the lanes of the map that actually are being considered for internal computations like:

  • ::ad::map::match::AdMapMatching()
  • ::ad::map::route::extendRouteToDistance()
  • ::ad::map::route::planning::predictRoutesOnDistance() If the map area is restricted by one of the following functions, all the map based operations will be performed as if the rest of the map would not exist at all.

restriction of the map area to an explicit list of lanes

This function sets the lane to consider for all map operations.

Parameters
[in]lanesToConsiderthe lanes of the map to be considered

◆ restrictOperationToMapArea() [2/3]

template<class OBJECT_INSTANCE_TYPE >
bool ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::restrictOperationToMapArea ( ::ad::map::point::BoundingSphere const &  bounding_sphere)

restriction of the map area to a bounding sphere

This function collects all lane within the given bounding sphere in a LaneIdSet to consider for all map operations. For collecting the lanes ::ad::map::lane::isNear() is called that checks for overlapping of the bounding sphere of the lane and the given bounding sphere.

Parameters
[in]bounding_spherethe bounding sphere of the map area to be considered
Returns
true if the map area is filled

◆ restrictOperationToMapArea() [3/3]

template<class OBJECT_INSTANCE_TYPE >
bool ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::restrictOperationToMapArea ( std::vector< ad::map::lane::MapAreaPredictionStartPoint > const &  predictionStartPoints)

restriction of the map area to a set of reachable lanes

This function collects all reachable lanes from the given list of input MapAreaPredictionStartPoint to consider for all map operations.

Parameters
[in]predictionStartPointsthe start points used to perform route prediction with respective prediction distance and route creation mode
Returns
true if the map area is filled

◆ situationCreated()

template<class OBJECT_INSTANCE_TYPE >
virtual void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::situationCreated ( RssRouteCheckerEgoVehicleData< OBJECT_INSTANCE_TYPE > const &  ego_vehicle,
RssRouteCheckResult rssRouteCheckResult 
)
inlineprotectedvirtual

callback after the rssRouteCheckResult situations has been created for the respective ego vehicle

Filled members of rssRouteCheckResult:

  • rss_route
  • world_model

◆ situationsCreated()

template<class OBJECT_INSTANCE_TYPE >
virtual void ad::rss::map::RssRouteChecker< OBJECT_INSTANCE_TYPE >::situationsCreated ( RssRouteCheckerEgoVehicleData< OBJECT_INSTANCE_TYPE > const &  ego_vehicle,
RssObjectResult rssObjectResult 
)
inlineprotectedvirtual

callback after all rssRouteCheckResult situations have been created for the respective ego vehicle

Filled members of respective rssRouteCheckResult:

  • rss_route
  • world_model

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