ad_rss_map_integration
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ad::rss::map::RssObjectConversion Class Reference

class providing support to convert ad::map objects into ad::rss objects More...

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

Public Types

using Ptr = std::shared_ptr< RssObjectConversion >
 Smart pointer on RssObjectConversion.
 
using ConstPtr = std::shared_ptr< RssObjectConversion const >
 Smart pointer on constant RssObjectConversion.
 

Public Member Functions

 RssObjectConversion (RssObjectData const &object_data)
 constructor More...
 
 RssObjectConversion (RssObjectData const &object_data, ::ad::rss::world::OccupiedRegionVector const &objectOccupiedRegions)
 constructor with explicit occupied regions More...
 
 RssObjectConversion (const RssObjectConversion &other)=default
 standard copy constructor
 
 RssObjectConversion (RssObjectConversion &&other)=default
 standard move constructor
 
 ~RssObjectConversion ()=default
 standard destructor
 
RssObjectConversionoperator= (const RssObjectConversion &other)=delete
 delete standard assignment operator
 
RssObjectConversionoperator= (RssObjectConversion &&other)=delete
 delete standard move assignment operator
 
::ad::rss::world::RssDynamics getRssDynamics () const
 
::ad::rss::world::Object const & getRssObject () const
 
::ad::rss::world::ObjectId getId () const
 
bool calculateConservativeMinStoppingDistance (::ad::physics::Distance &conservativeMinStoppingDistance) const
 
void updateSpeedLimit (::ad::physics::Speed const &max_speed_on_acceleration)
 update the max speed content
 
void laneIntervalAdded (::ad::map::route::LaneInterval const &lane_interval)
 lane interval was added to the object route, so append relevant occupied regions
 
void updateVelocityOnRoute (::ad::map::point::ENUHeading const &route_heading)
 update the objects current velocity on the route considering the provided route_heading More...
 
bool updateVelocityOnRoute (::ad::map::route::FullRoute const &route)
 update the objects current velocity on the route More...
 
::ad::map::match::Object const * getObjectMapMatchedPosition () const
 return the map matched position object this was created with (might be nullptr)
 
bool isOriginalSpeedAcceptable (::ad::physics::Speed const acceptableNegativeSpeed=::ad::physics::Speed(-0.5)) const
 check if the original input speed is in acceptable range More...
 
::ad::physics::SpeedRange const & getOriginalObjectSpeed () const
 
::ad::physics::Distance getDistanceEstimate (RssObjectConversion::ConstPtr other) const
 
::ad::physics::Distance getVehicleLength () const
 
::ad::physics::Distance getVehicleWidth () const
 

Static Public Member Functions

static bool calculateConservativeMinStoppingDistance (::ad::rss::world::ObjectId const &object_id, ::ad::physics::Speed const &current_speed, ::ad::rss::world::RssDynamics const &rss_dynamics, ::ad::physics::Distance &conservativeMinStoppingDistance)
 

Detailed Description

class providing support to convert ad::map objects into ad::rss objects

Constructor & Destructor Documentation

◆ RssObjectConversion() [1/2]

ad::rss::map::RssObjectConversion::RssObjectConversion ( RssObjectData const &  object_data)
explicit

constructor

Parameters
[in]object_datathe object data

◆ RssObjectConversion() [2/2]

ad::rss::map::RssObjectConversion::RssObjectConversion ( RssObjectData const &  object_data,
::ad::rss::world::OccupiedRegionVector const &  objectOccupiedRegions 
)

constructor with explicit occupied regions

Parameters
[in]object_datathe object data
[in]objectOccupiedRegionsthe object's occupied regions explicitly

Member Function Documentation

◆ calculateConservativeMinStoppingDistance() [1/2]

bool ad::rss::map::RssObjectConversion::calculateConservativeMinStoppingDistance ( ::ad::physics::Distance &  conservativeMinStoppingDistance) const

This is an estimate, that can be used to calculate the route calculation distance to be taken into account. It uses conservative expectations, i.e. brake_min_correct and no limitation of speed on acceleration.

Parameters
[out]conservativeMinStoppingDistancethe minimum distance for the object to stop calculated in a conservative way
Returns
boolean indicating success(true)/failure(false) of the calculation

◆ calculateConservativeMinStoppingDistance() [2/2]

static bool ad::rss::map::RssObjectConversion::calculateConservativeMinStoppingDistance ( ::ad::rss::world::ObjectId const &  object_id,
::ad::physics::Speed const &  current_speed,
::ad::rss::world::RssDynamics const &  rss_dynamics,
::ad::physics::Distance &  conservativeMinStoppingDistance 
)
static

This is an estimate, that can be used to calculate the route calculation distances to be taken into account. It uses conservative expectations, i.e. brake_min_correct and no limitation of speed on acceleration.

Parameters
[in]object_idthe object_id (for debug messages only)
[in]current_speedthe objects current speed
[in]rss_dynamicsthe RssDynamics to consider
[out]conservativeMinStoppingDistancethe minimum distance for the object to stop calculated in a conservative way
Returns
boolean indicating success(true)/failure(false) of the calculation

◆ getDistanceEstimate()

::ad::physics::Distance ad::rss::map::RssObjectConversion::getDistanceEstimate ( RssObjectConversion::ConstPtr  other) const
Returns
the distance estimate towards the other object The distance uses Euclidian distance of the center points as an estimate.

◆ getId()

::ad::rss::world::ObjectId ad::rss::map::RssObjectConversion::getId ( ) const
Returns
Object id

◆ getOriginalObjectSpeed()

::ad::physics::SpeedRange const& ad::rss::map::RssObjectConversion::getOriginalObjectSpeed ( ) const
inline
Returns
the original object speed provided as input

◆ getRssDynamics()

::ad::rss::world::RssDynamics ad::rss::map::RssObjectConversion::getRssDynamics ( ) const
Returns
RssDynamics of the object

If updateSpeedLimit() was called in between the max_speed_on_acceleration value of the dynamics will be adapted to these.

◆ getRssObject()

::ad::rss::world::Object const& ad::rss::map::RssObjectConversion::getRssObject ( ) const
Returns
RSS Object description

If laneIntervalAdded() or fillNotRelevantConstellationBoundingBox() was called in between the occupied regions have been filled accordingly. If not, these are empty (which is an invalid object!)

◆ getVehicleLength()

::ad::physics::Distance ad::rss::map::RssObjectConversion::getVehicleLength ( ) const
inline
Returns
the length of the vehicle

◆ getVehicleWidth()

::ad::physics::Distance ad::rss::map::RssObjectConversion::getVehicleWidth ( ) const
inline
Returns
the width of the vehicle

◆ isOriginalSpeedAcceptable()

bool ad::rss::map::RssObjectConversion::isOriginalSpeedAcceptable ( ::ad::physics::Speed const  acceptableNegativeSpeed = ::ad::physics::Speed(-0.5)) const

check if the original input speed is in acceptable range

Negative speed is not supported by the RSS implementation; therefore negative input speeds are mapped to zero speed by this class.

But up to a certain small negative speed value, negative speeds still might want to be accepted to account for slowly backward drifting vehicles. Therefore, the constructor of this class maps all negative speeds to zero, but stores the original provided speed for later analysis. This function can be used to check for an acceptable speed.

Parameters
[in]acceptableNegativeSpeeda small negative speed value that should be allowed to be mapped to zero without error (default -0.5m/s).
Returns
true if the original speed equals the current internal object speed. It also returns true if the original speed is equal or larger than the provided acceptableNegativeSpeed.

◆ updateVelocityOnRoute() [1/2]

void ad::rss::map::RssObjectConversion::updateVelocityOnRoute ( ::ad::map::point::ENUHeading const &  route_heading)

update the objects current velocity on the route considering the provided route_heading

Use this overload if the route is derived from a ad::map::route::ConnectingRoute by using the heading calculations from the ConnectingRoute type, as the object bounding boxes are usually removed from the connecting route. Like this, the object is more or less touching the route and the other overload taking the route as parameter might not be able to extract the heading.

◆ updateVelocityOnRoute() [2/2]

bool ad::rss::map::RssObjectConversion::updateVelocityOnRoute ( ::ad::map::route::FullRoute const &  route)

update the objects current velocity on the route

The bounding box of the object has to be part of the provided route to be able to extract the route heading correctly. Therefore, use this overload if the route was calculated by the ad::map::route::planning::planRoute() or ad::map::route::planning::predictRoute() functions and no heading information is available yet by other means. If the route is derived from a ad::map::route::ConnectingRoute use the overload with the pre-calcuated heading.

Returns
true if the operation succeeded

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