ad_rss
|
namespace situation More...
Classes | |
struct | RelativePosition |
DataType RelativePosition. More... | |
struct | Situation |
DataType Situation. More... | |
struct | SituationSnapshot |
DataType SituationSnapshot. More... | |
struct | VehicleState |
DataType VehicleState. More... | |
struct | VelocityRange |
DataType VelocityRange. More... | |
Typedefs | |
typedef uint64_t | SituationId |
DataType SituationId. More... | |
typedef std::vector<::ad::rss::situation::Situation > | SituationVector |
DataType SituationVector. More... | |
Enumerations | |
enum | LateralRelativePosition : int32_t { LateralRelativePosition::AtLeft = 0, LateralRelativePosition::OverlapLeft = 1, LateralRelativePosition::Overlap = 2, LateralRelativePosition::OverlapRight = 3, LateralRelativePosition::AtRight = 4 } |
DataType LateralRelativePosition. More... | |
enum | LongitudinalRelativePosition : int32_t { LongitudinalRelativePosition::InFront = 0, LongitudinalRelativePosition::OverlapFront = 1, LongitudinalRelativePosition::Overlap = 2, LongitudinalRelativePosition::OverlapBack = 3, LongitudinalRelativePosition::AtBack = 4 } |
DataType LongitudinalRelativePosition. More... | |
enum | SituationType : int32_t { SituationType::NotRelevant = 0, SituationType::SameDirection = 1, SituationType::OppositeDirection = 2, SituationType::IntersectionEgoHasPriority = 3, SituationType::IntersectionObjectHasPriority = 4, SituationType::IntersectionSamePriority = 5, SituationType::Unstructured = 6 } |
DataType SituationType. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &os, LateralRelativePosition const &value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, LongitudinalRelativePosition const &value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, RelativePosition const &_value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, Situation const &_value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, SituationSnapshot const &_value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, SituationType const &value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, VehicleState const &_value) |
standard ostream operator More... | |
std::ostream & | operator<< (std::ostream &os, VelocityRange const &_value) |
standard ostream operator More... | |
bool | calculateDistanceOffsetInAcceleratedMovement (physics::Speed const speed, physics::Acceleration const acceleration, physics::Duration const duration, physics::Distance &distanceOffset) |
Calculate the distance traveled after a given period of time on a constant accelerated movement. More... | |
bool | calculateSpeedInAcceleratedMovement (physics::Speed const speed, physics::Acceleration const acceleration, physics::Duration const duration, physics::Speed &resultingSpeed) |
Calculate the speed after a given period of time on a constant accelerated movement. More... | |
bool | calculateStoppingDistance (physics::Speed const currentSpeed, physics::Acceleration const deceleration, physics::Distance &stoppingDistance) |
Calculate the stopping distance for a given speed and deceleration on a constant accelerated movement. More... | |
bool | calculateAcceleratedLimitedMovement (physics::Speed const currentSpeed, physics::Speed const maxSpeedOnAcceleration, physics::Acceleration const acceleration, physics::Duration const duration, physics::Speed &resultingSpeed, physics::Distance &distanceOffset) |
Calculate the vehicle speed after a given period of time on a constant accelerated movement. More... | |
bool | calculateTimeToCoverDistance (physics::Speed const currentSpeed, physics::Speed const maxSpeedOnAcceleration, physics::Duration const responseTime, physics::Acceleration const aUntilResponseTime, physics::Acceleration const aAfterResponseTime, physics::Distance const distanceToCover, physics::Duration &requiredTime) |
Calculate the time needed to cover a given distance. More... | |
bool | calculateSpeedAndDistanceOffset (physics::Duration const duration, physics::Speed const currentSpeed, physics::Duration const responseTime, physics::Speed const maxSpeedOnAcceleration, physics::Acceleration const aUntilReponseTime, physics::Acceleration const aAfterResponseTime, physics::Speed &resultingSpeed, physics::Distance &distanceOffset) |
Calculate the speed and distance offset after a given duration in a two phased limited constant accelerated movement. More... | |
bool | calculateTimeToStop (physics::Speed const currentSpeed, physics::Duration const responseTime, physics::Speed const maxSpeedOnAcceleration, physics::Acceleration const aUntilResponseTime, physics::Acceleration const aAfterResponseTime, physics::Duration &stopDuration) |
Calculate the stopping time in a two phased limited constant accelerated movement. More... | |
bool | calculateLongitudinalDistanceOffsetAfterStatedBrakingPattern (physics::Speed const ¤tLongitudinalSpeed, physics::Speed const &maxSpeedOnAcceleration, physics::Duration const &responseTime, physics::Acceleration const &acceleration, physics::Acceleration const &deceleration, physics::Distance &distanceOffset) |
Calculate the longitudinal distance offset of a vehicle when applying the "stated braking pattern" with given deceleration. More... | |
bool | calculateLateralDistanceOffsetAfterStatedBrakingPattern (physics::Speed const ¤tLateralSpeed, physics::Duration const &responseTime, physics::Acceleration const &acceleration, physics::Acceleration const &deceleration, physics::Distance &distanceOffset) |
Calculate the lateral distance offset of a vehicle when applying the "stated braking pattern" with given deceleration. More... | |
bool | calculateSafeLongitudinalDistanceSameDirection (VehicleState const &leadingVehicle, VehicleState const &followingVehicle, physics::Distance &safeDistance) |
Calculate the "safe longitudinal distance" between the two vehicles, Assuming: Maximum deceleration for leading vehicle, and "stated breaking pattern" for following vehicle. More... | |
bool | checkSafeLongitudinalDistanceSameDirection (VehicleState const &leadingVehicle, VehicleState const &followingVehicle, physics::Distance const &vehicleDistance, physics::Distance &safeDistance, bool &isDistanceSafe) |
Check if the longitudinal distance between the two vehicles is safe. Assuming: Maximum deceleration for leading vehicle, and "stated breaking pattern" for following vehicle. More... | |
bool | calculateSafeLongitudinalDistanceOppositeDirection (VehicleState const &correctVehicle, VehicleState const &oppositeVehicle, physics::Distance &safeDistance) |
Calculate the safe longitudinal distance between to vehicles driving in opposite direction The calculation will assume that the correctVehicle is on the correct lane and oppositeVehicle on an opposite lane. More... | |
bool | checkSafeLongitudinalDistanceOppositeDirection (VehicleState const &correctVehicle, VehicleState const &oppositeVehicle, physics::Distance const &vehicleDistance, physics::Distance &safeDistance, bool &isDistanceSafe) |
Check if the longitudinal distance between to vehicles driving in opposite direction is safe. The check will assume that the correctVehicle is on the correct lane and oppositeVehicle on an opposite lane. More... | |
bool | checkStopInFrontIntersection (VehicleState const &vehicle, physics::Distance &safeDistance, bool &isDistanceSafe) |
Check if the vehicle can safely break longitudinaly in front of the intersection. Assuming: Using "stated breaking pattern" for breaking. More... | |
bool | calculateSafeLateralDistance (VehicleState const &leftVehicle, VehicleState const &rightVehicle, physics::Distance &safeDistance) |
Calculate the "safe lateral distance" between the two vehicles, Assuming: Both vehicles apply "stated breaking pattern". More... | |
bool | checkSafeLateralDistance (VehicleState const &leftVehicle, VehicleState const &rightVehicle, physics::Distance const &vehicleDistance, physics::Distance &safeDistance, bool &isDistanceSafe) |
Check if the lateral distance between to vehicles is safe Assuming: Both vehicles apply "stated breaking pattern". More... | |
namespace situation
Forward declaration.
typedef uint64_t ad::rss::situation::SituationId |
DataType SituationId.
The unique id of an situation over time.
typedef std::vector<::ad::rss::situation::Situation> ad::rss::situation::SituationVector |
DataType SituationVector.
A vector of situations.
|
strong |
DataType LateralRelativePosition.
Enumeration describing the relative lateral position between two objects, a and b, within their situation coordinate system.
|
strong |
DataType LongitudinalRelativePosition.
Enumeration describing the relative longitudinal position between two objects, a and b, within their situation coordinate system.
|
strong |
DataType SituationType.
Enumeration describing the type of situation.
bool ad::rss::situation::calculateAcceleratedLimitedMovement | ( | physics::Speed const | currentSpeed, |
physics::Speed const | maxSpeedOnAcceleration, | ||
physics::Acceleration const | acceleration, | ||
physics::Duration const | duration, | ||
physics::Speed & | resultingSpeed, | ||
physics::Distance & | distanceOffset | ||
) |
Calculate the vehicle speed after a given period of time on a constant accelerated movement.
The accelerated movement (acceleration>0) is limited: The acceleration stops if the speed reaches a limiting maximum speed. The decelerated movement (acceleration<0) is limited: The deceleration stops if the speed reaches zero. Especially, the vehicle is not starting to drive in reverse direction after standing still (In this case, it's equal to the stopping distance)
[in] | currentSpeed | is the current speed of the vehicle (has to be always positive) |
[in] | maxSpeedOnAcceleration | is the maximum speed of the vehicle (e.g. restricted by a limit) to be considered while accelerating (if acceleration >0) (has to be always positive) |
[in] | acceleration | is the acceleration of the vehicle |
[in] | duration | is the (positive) period of time the vehicle keeps accelerating |
[out] | resultingSpeed | is the resulting speed after duration (resultingSpeed >= 0) |
[out] | distanceOffset | is the distance offset from the current position (distanceOffset >= 0) |
bool ad::rss::situation::calculateDistanceOffsetInAcceleratedMovement | ( | physics::Speed const | speed, |
physics::Acceleration const | acceleration, | ||
physics::Duration const | duration, | ||
physics::Distance & | distanceOffset | ||
) |
Calculate the distance traveled after a given period of time on a constant accelerated movement.
[in] | speed | is the current speed |
[in] | acceleration | is the acceleration value to be considered |
[in] | duration | is the (positive) period of time the acceleration is performed |
[out] | distanceOffset | is the distance offset from the current position. |
bool ad::rss::situation::calculateLateralDistanceOffsetAfterStatedBrakingPattern | ( | physics::Speed const & | currentLateralSpeed, |
physics::Duration const & | responseTime, | ||
physics::Acceleration const & | acceleration, | ||
physics::Acceleration const & | deceleration, | ||
physics::Distance & | distanceOffset | ||
) |
Calculate the lateral distance offset of a vehicle when applying the "stated braking pattern" with given deceleration.
[in] | currentLateralSpeed | is the current lateral vehicle speed |
[in] | responseTime | is the response time of the vehicle |
[in] | acceleration | the acceleration of the vehicle during responseTime |
[in] | deceleration | is the applied breaking deceleration |
[out] | distanceOffset | is the distance offset of the vehicle from the current position after "the stated braking pattern" |
bool ad::rss::situation::calculateLongitudinalDistanceOffsetAfterStatedBrakingPattern | ( | physics::Speed const & | currentLongitudinalSpeed, |
physics::Speed const & | maxSpeedOnAcceleration, | ||
physics::Duration const & | responseTime, | ||
physics::Acceleration const & | acceleration, | ||
physics::Acceleration const & | deceleration, | ||
physics::Distance & | distanceOffset | ||
) |
Calculate the longitudinal distance offset of a vehicle when applying the "stated braking pattern" with given deceleration.
[in] | currentLongitudinalSpeed | is the current longitudinal vehicle speed |
[in] | maxSpeedOnAcceleration | is the maximum vehicle speed to be considered in accelerated movement |
[in] | responseTime | is the response time of the vehicle |
[in] | acceleration | the acceleration of the vehicle during responseTime |
[in] | deceleration | is the applied breaking deceleration |
[out] | distanceOffset | is the distance offset of the vehicle from the current position after "the stated braking pattern" |
bool ad::rss::situation::calculateSafeLateralDistance | ( | VehicleState const & | leftVehicle, |
VehicleState const & | rightVehicle, | ||
physics::Distance & | safeDistance | ||
) |
Calculate the "safe lateral distance" between the two vehicles, Assuming: Both vehicles apply "stated breaking pattern".
Left vehicle --> | | v ^ | | Right vehicle -->
======================================================
[in] | leftVehicle | is the state of the left vehicle |
[in] | rightVehicle | is the state of the right vehicle |
[out] | safeDistance | is the calculated safe lateral distance |
bool ad::rss::situation::calculateSafeLongitudinalDistanceOppositeDirection | ( | VehicleState const & | correctVehicle, |
VehicleState const & | oppositeVehicle, | ||
physics::Distance & | safeDistance | ||
) |
Calculate the safe longitudinal distance between to vehicles driving in opposite direction The calculation will assume that the correctVehicle is on the correct lane and oppositeVehicle on an opposite lane.
So calculation for the correctVehicle is performed with brakeMinCorrect and performed with brakeMin for the oppositeVehicle
correctVehicle ---> <--- oppositeVehicle
======================================================
[in] | correctVehicle | is the state of the vehicle driving in the correct lane |
[in] | oppositeVehicle | is the state of the vehicle driving in the wrong lane |
[out] | isDistanceSafe | true if the distance is safe, false otherwise |
bool ad::rss::situation::calculateSafeLongitudinalDistanceSameDirection | ( | VehicleState const & | leadingVehicle, |
VehicleState const & | followingVehicle, | ||
physics::Distance & | safeDistance | ||
) |
Calculate the "safe longitudinal distance" between the two vehicles, Assuming: Maximum deceleration for leading vehicle, and "stated breaking pattern" for following vehicle.
FollowingVehicle ---> LeadingVehicle --->
======================================================
[in] | leadingVehicle | is the state of the leading vehicle |
[in] | followingVehicle | is the state of the following vehicle |
[out] | safeDistance | is the calculated safe longitudinal distance |
bool ad::rss::situation::calculateSpeedAndDistanceOffset | ( | physics::Duration const | duration, |
physics::Speed const | currentSpeed, | ||
physics::Duration const | responseTime, | ||
physics::Speed const | maxSpeedOnAcceleration, | ||
physics::Acceleration const | aUntilReponseTime, | ||
physics::Acceleration const | aAfterResponseTime, | ||
physics::Speed & | resultingSpeed, | ||
physics::Distance & | distanceOffset | ||
) |
Calculate the speed and distance offset after a given duration in a two phased limited constant accelerated movement.
The function will use two values for acceleration, one until reaching the response time, the second one afterwards.
[in] | duration | the duration for which the speed gets calculated |
[in] | currentSpeed | starting velocity |
[in] | responseTime | the time after which aAfterResponseTime is used instead of aUntilResponseTime as acceleration |
[in] | maxSpeedOnAcceleration | is the maximum speed of the vehicle (has to be always positive) to be considered while accelerating |
[in] | aUntilResponseTime | acceleration until response time |
[in] | aAfterResponseTime | acceleration after response time |
[out] | resultingSpeed | resulting speed after duration |
[out] | distanceOffset | resulting distance |
bool ad::rss::situation::calculateSpeedInAcceleratedMovement | ( | physics::Speed const | speed, |
physics::Acceleration const | acceleration, | ||
physics::Duration const | duration, | ||
physics::Speed & | resultingSpeed | ||
) |
Calculate the speed after a given period of time on a constant accelerated movement.
[in] | speed | is the current speed |
[in] | acceleration | is the acceleration value to be considered |
[in] | duration | is the (positive) period of time the acceleration is performed |
[out] | resultingSpeed | is the resulting speed after duration |
bool ad::rss::situation::calculateStoppingDistance | ( | physics::Speed const | currentSpeed, |
physics::Acceleration const | deceleration, | ||
physics::Distance & | stoppingDistance | ||
) |
Calculate the stopping distance for a given speed and deceleration on a constant accelerated movement.
[in] | currentSpeed | is the current speed of the vehicle |
[in] | deceleration | is the applied deceleration |
[out] | stoppingDistance | is the resulting stopping distance The sign of the stoppingDistance equals the sign of the currentSpeed. |
bool ad::rss::situation::calculateTimeToCoverDistance | ( | physics::Speed const | currentSpeed, |
physics::Speed const | maxSpeedOnAcceleration, | ||
physics::Duration const | responseTime, | ||
physics::Acceleration const | aUntilResponseTime, | ||
physics::Acceleration const | aAfterResponseTime, | ||
physics::Distance const | distanceToCover, | ||
physics::Duration & | requiredTime | ||
) |
Calculate the time needed to cover a given distance.
The function will use two values for acceleration, one until reaching the response time, the second one afterwards. If the distance is not covered when then velocity reaches zero, infinite time will be returned
[in] | currentSpeed | starting velocity |
[in] | maxSpeedOnAcceleration | is the maximum speed of the vehicle (has to be always positive) to be considered while accelerating |
[in] | responseTime | the time after which aAfterResponseTime is used instead of aUntilResponseTime as acceleration |
[in] | aUntilResponseTime | during response time |
[in] | aAfterResponseTime | after response time |
[in] | distanceToCover | distance that should be covered |
[out] | requiredTime | time needed to cover the distance |
bool ad::rss::situation::calculateTimeToStop | ( | physics::Speed const | currentSpeed, |
physics::Duration const | responseTime, | ||
physics::Speed const | maxSpeedOnAcceleration, | ||
physics::Acceleration const | aUntilResponseTime, | ||
physics::Acceleration const | aAfterResponseTime, | ||
physics::Duration & | stopDuration | ||
) |
Calculate the stopping time in a two phased limited constant accelerated movement.
The function will use two values for acceleration, one until reaching the response time, the second one afterwards.
[in] | currentSpeed | starting velocity |
[in] | responseTime | the time after which aAfterResponseTime is used instead of aUntilResponseTime as acceleration |
[in] | maxSpeedOnAcceleration | is the maximum speed of the vehicle (has to be always positive) to be considered while accelerating |
[in] | aUntilResponseTime | acceleration until response time |
[in] | aAfterResponseTime | acceleration after response time |
[out] | stopDuration | resulting duration |
bool ad::rss::situation::checkSafeLateralDistance | ( | VehicleState const & | leftVehicle, |
VehicleState const & | rightVehicle, | ||
physics::Distance const & | vehicleDistance, | ||
physics::Distance & | safeDistance, | ||
bool & | isDistanceSafe | ||
) |
Check if the lateral distance between to vehicles is safe Assuming: Both vehicles apply "stated breaking pattern".
Left vehicle --> | | v ^ | | Right vehicle -->
======================================================
[in] | leftVehicle | is the state of the left vehicle |
[in] | rightVehicle | is the state of the right vehicle |
[in] | vehicleDistance | the (positive) lateral distance between the two vehicles |
[out] | safeDistance | is the calculated safe lateral distance |
[out] | isDistanceSafe | is true if the distance is safe, false otherwise |
bool ad::rss::situation::checkSafeLongitudinalDistanceOppositeDirection | ( | VehicleState const & | correctVehicle, |
VehicleState const & | oppositeVehicle, | ||
physics::Distance const & | vehicleDistance, | ||
physics::Distance & | safeDistance, | ||
bool & | isDistanceSafe | ||
) |
Check if the longitudinal distance between to vehicles driving in opposite direction is safe. The check will assume that the correctVehicle is on the correct lane and oppositeVehicle on an opposite lane.
So check for the correctVehcile is performed with brakeMinCorrect and performed with brakeMin for the oppositeVehicle
correctVehicle ---> <--- oppositeVehicle
======================================================
[in] | correctVehicle | is the state of the vehicle driving in the correct lane |
[in] | oppositeVehicle | is the state of the vehicle driving in the wrong lane |
[in] | vehicleDistance | the (positive) longitudinal distance between the two vehicles |
[out] | safeDistance | is the calculated safe longitudinal distance |
[out] | isDistanceSafe | true if the distance is safe, false otherwise |
bool ad::rss::situation::checkSafeLongitudinalDistanceSameDirection | ( | VehicleState const & | leadingVehicle, |
VehicleState const & | followingVehicle, | ||
physics::Distance const & | vehicleDistance, | ||
physics::Distance & | safeDistance, | ||
bool & | isDistanceSafe | ||
) |
Check if the longitudinal distance between the two vehicles is safe. Assuming: Maximum deceleration for leading vehicle, and "stated breaking pattern" for following vehicle.
FollowingVehicle ---> LeadingVehicle --->
======================================================
[in] | leadingVehicle | is the state of the leading vehicle |
[in] | followingVehicle | is the state of the following vehicle |
[in] | vehicleDistance | the (positive) longitudinal distance between the two vehicles |
[out] | safeDistance | is the calculated safe longitudinal distance |
[out] | isDistanceSafe | true if the distance is safe, false otherwise |
bool ad::rss::situation::checkStopInFrontIntersection | ( | VehicleState const & | vehicle, |
physics::Distance & | safeDistance, | ||
bool & | isDistanceSafe | ||
) |
Check if the vehicle can safely break longitudinaly in front of the intersection. Assuming: Using "stated breaking pattern" for breaking.
vehicle ---> | Intersection |
============================== =============== | | | |
[in] | vehicle | is the state of the vehicle |
[out] | safeDistance | the safe distance according to the stated braking pattern |
[out] | isDistanceSafe | true if the distance is safe, false otherwise |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | value | LateralRelativePosition value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | value | LongitudinalRelativePosition value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | _value | RelativePosition value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | _value | Situation value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | _value | SituationSnapshot value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | value | SituationType value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | _value | VehicleState value |
|
inline |
standard ostream operator
[in] | os | The output stream to write to |
[in] | _value | VelocityRange value |