intel / ad-rss-lib

Library implementing the Responsibility Sensitive Safety model (RSS) for Autonomous Vehicles
https://intel.github.io/ad-rss-lib/
GNU Lesser General Public License v2.1
336 stars 138 forks source link

LaneDirection estimation in RssObjectPositionExtractor::newLaneSegment #106

Closed xiaong closed 3 years ago

xiaong commented 3 years ago

One question for positive lane or negative lane estimation logic: In RssObjectPositionExtractor::newLaneSegment the object lane direction is gotten from laneSegment laneDrivingDirection. But if the object is occupying both positive and negtive lane, the lane type will be overwritten by the last occupied laneSegment. Will there be a logic bug?

if (laneSegment.drivingDirection == LaneDrivingDirection::Positive)
      {
        mObjectDimensions.onPositiveLane = true;
      }

      if (laneSegment.drivingDirection == LaneDrivingDirection::Negative)
      {
        mObjectDimensions.onNegativeLane = true;
      }

THX!

berndgassmann commented 3 years ago

Hi, this function is collecting both information, because it's collecting onPositiveLane as well as onNegativeLane flag. At this place nothing is overwritten. In case the vehicle is touching both kind of lanes, both flags are true.

That information is later used to determine if the the vehicle is in respect to the current situation actually on the correct lane or not by filling the isInCorrectLane flag for Non-Intersection-Cases and for Intersection cases. In general isInCorrectLane flag is only relevant in the opposite use-case to distinguish between BrakeMin and BrakeMinCorrect expected braking deceleration.

I hope this answers your question and clears your doubts.

xiaong commented 3 years ago

Got it. Thank you for your answer!