ad_rss
RssObjectPositionExtractor.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2018-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: LGPL-2.1-only
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <limits>
15 #include "ad/rss/world/Object.hpp"
17 
21 namespace ad {
25 namespace rss {
29 namespace structured {
30 
35 {
36 public:
38  {
39  longitudinalDimensions.maximum = std::numeric_limits<physics::Distance>::lowest();
40  longitudinalDimensions.minimum = std::numeric_limits<physics::Distance>::max();
41 
42  lateralDimensions.maximum = std::numeric_limits<physics::Distance>::lowest();
43  lateralDimensions.minimum = std::numeric_limits<physics::Distance>::max();
44  }
45 
49  physics::MetricRange longitudinalDimensions;
50 
54  physics::MetricRange lateralDimensions;
55 
59  bool onPositiveLane{false};
60 
64  bool onNegativeLane{false};
65 
72  physics::MetricRange intersectionPosition;
73 };
74 
84 {
85 public:
91  explicit RssObjectPositionExtractor(world::OccupiedRegionVector const &occupied_regions);
92 
102  bool newRoadSegment(physics::MetricRange const &longitudinalStart, world::RoadSegment const &roadSegment);
103 
112  bool newLaneSegment(physics::MetricRange lateral_distance, world::LaneSegment const &laneSegment);
113 
121  bool getObjectDimensions(ObjectDimensions &objectDimensions);
122 
123 private:
124  world::OccupiedRegionVector mOccupiedRegions;
125 
126  physics::MetricRange mCurrentLongitudinalRoadSegmentStart;
127  physics::Distance mRoadSegmentMinLengthAfterIntersectingArea{0.};
128 
129  enum class IntersectionState
130  {
131  BeforeIntersection,
132  WithinIntersection,
133  AfterIntersection
134  };
135  IntersectionState mIntersectionState{IntersectionState::BeforeIntersection};
136 
137  ObjectDimensions mObjectDimensions;
138 };
139 
140 } // namespace structured
141 } // namespace rss
142 } // namespace ad
class to store information of object position dimensions
Definition: RssObjectPositionExtractor.hpp:35
bool onPositiveLane
flag to indicate if the object is on the positive driving lane
Definition: RssObjectPositionExtractor.hpp:59
physics::MetricRange intersectionPosition
range of intersection position
Definition: RssObjectPositionExtractor.hpp:72
bool onNegativeLane
flag to indicate if the object is on the negative driving lane
Definition: RssObjectPositionExtractor.hpp:64
physics::MetricRange longitudinalDimensions
range of longitudinal object position
Definition: RssObjectPositionExtractor.hpp:49
physics::MetricRange lateralDimensions
range of lateral object position
Definition: RssObjectPositionExtractor.hpp:54
class to calculate object positions
Definition: RssObjectPositionExtractor.hpp:84
RssObjectPositionExtractor(world::OccupiedRegionVector const &occupied_regions)
Constructor.
bool newLaneSegment(physics::MetricRange lateral_distance, world::LaneSegment const &laneSegment)
Add information of the next adjacent laneSegement.
bool getObjectDimensions(ObjectDimensions &objectDimensions)
Retrieve the objectDimension information back from the class.
bool newRoadSegment(physics::MetricRange const &longitudinalStart, world::RoadSegment const &roadSegment)
Indicate that there is a new road segment.
std::vector<::ad::rss::world::OccupiedRegion > OccupiedRegionVector
DataType OccupiedRegionVector.
Definition: OccupiedRegionVector.hpp:42
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType LaneSegment.
Definition: LaneSegment.hpp:46
DataType RoadSegment.
Definition: RoadSegment.hpp:49