ad_rss
VehicleState.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 Intel Corporation
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <iostream>
21 #include <limits>
22 #include <memory>
23 #include <sstream>
24 #include "ad/physics/Distance.hpp"
32 namespace ad {
36 namespace rss {
40 namespace situation {
41 
52 {
56  typedef std::shared_ptr<VehicleState> Ptr;
57 
61  typedef std::shared_ptr<VehicleState const> ConstPtr;
62 
66  VehicleState() = default;
67 
71  ~VehicleState() = default;
72 
76  VehicleState(const VehicleState &other) = default;
77 
81  VehicleState(VehicleState &&other) = default;
82 
90  VehicleState &operator=(const VehicleState &other) = default;
91 
99  VehicleState &operator=(VehicleState &&other) = default;
100 
108  bool operator==(const VehicleState &other) const
109  {
110  return (velocity == other.velocity) && (dynamics == other.dynamics) && (hasPriority == other.hasPriority)
111  && (isInCorrectLane == other.isInCorrectLane)
114  && (objectState == other.objectState);
115  }
116 
124  bool operator!=(const VehicleState &other) const
125  {
126  return !operator==(other);
127  }
128 
134 
139 
143  bool hasPriority{false};
144 
148  bool isInCorrectLane{false};
149 
153  ::ad::physics::Distance distanceToEnterIntersection{std::numeric_limits<::ad::physics::Distance>::max()};
154 
158  ::ad::physics::Distance distanceToLeaveIntersection{std::numeric_limits<::ad::physics::Distance>::max()};
159 
164 
169 };
170 
171 } // namespace situation
172 } // namespace rss
173 } // namespace ad
174 
178 #ifndef GEN_GUARD_AD_RSS_SITUATION_VEHICLESTATE
179 #define GEN_GUARD_AD_RSS_SITUATION_VEHICLESTATE
180 
183 namespace ad {
187 namespace rss {
191 namespace situation {
192 
202 inline std::ostream &operator<<(std::ostream &os, VehicleState const &_value)
203 {
204  os << "VehicleState(";
205  os << "velocity:";
206  os << _value.velocity;
207  os << ",";
208  os << "dynamics:";
209  os << _value.dynamics;
210  os << ",";
211  os << "hasPriority:";
212  os << _value.hasPriority;
213  os << ",";
214  os << "isInCorrectLane:";
215  os << _value.isInCorrectLane;
216  os << ",";
217  os << "distanceToEnterIntersection:";
218  os << _value.distanceToEnterIntersection;
219  os << ",";
220  os << "distanceToLeaveIntersection:";
221  os << _value.distanceToLeaveIntersection;
222  os << ",";
223  os << "objectType:";
224  os << _value.objectType;
225  os << ",";
226  os << "objectState:";
227  os << _value.objectState;
228  os << ")";
229  return os;
230 }
231 
232 } // namespace situation
233 } // namespace rss
234 } // namespace ad
235 
236 namespace std {
240 inline std::string to_string(::ad::rss::situation::VehicleState const &value)
241 {
242  stringstream sstream;
243  sstream << value;
244  return sstream.str();
245 }
246 } // namespace std
247 #endif // GEN_GUARD_AD_RSS_SITUATION_VEHICLESTATE
ad::rss::situation::VehicleState::ConstPtr
std::shared_ptr< VehicleState const > ConstPtr
Smart pointer on constant VehicleState.
Definition: VehicleState.hpp:61
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
VelocityRange.hpp
ad::rss::situation::VehicleState::operator!=
bool operator!=(const VehicleState &other) const
standard comparison operator
Definition: VehicleState.hpp:124
ad::rss::situation::VehicleState::distanceToEnterIntersection
::ad::physics::Distance distanceToEnterIntersection
Definition: VehicleState.hpp:153
ad::rss::situation::VehicleState::velocity
::ad::rss::situation::VelocityRange velocity
Definition: VehicleState.hpp:133
ad::rss::situation::VehicleState
DataType VehicleState.
Definition: VehicleState.hpp:51
ad::rss::situation::VehicleState::VehicleState
VehicleState()=default
standard constructor
ad::rss::world::ObjectType
ObjectType
DataType ObjectType.
Definition: ObjectType.hpp:41
std::to_string
std::string to_string(::ad::rss::situation::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:160
ad::rss::situation::VehicleState::dynamics
::ad::rss::world::RssDynamics dynamics
Definition: VehicleState.hpp:138
ObjectType.hpp
ad::rss::world::RssDynamics
DataType RssDynamics.
Definition: RssDynamics.hpp:50
ObjectState.hpp
ad::rss::situation::operator<<
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:147
ad::rss::situation::VehicleState::Ptr
std::shared_ptr< VehicleState > Ptr
Smart pointer on VehicleState.
Definition: VehicleState.hpp:56
ad::rss::situation::VehicleState::distanceToLeaveIntersection
::ad::physics::Distance distanceToLeaveIntersection
Definition: VehicleState.hpp:158
ad::rss::situation::VehicleState::objectType
::ad::rss::world::ObjectType objectType
Definition: VehicleState.hpp:163
ad::rss::world::ObjectState
DataType ObjectState.
Definition: ObjectState.hpp:51
ad::rss::situation::VehicleState::~VehicleState
~VehicleState()=default
standard destructor
ad::rss::situation::VehicleState::hasPriority
bool hasPriority
Definition: VehicleState.hpp:143
ad::rss::situation::VehicleState::isInCorrectLane
bool isInCorrectLane
Definition: VehicleState.hpp:148
ad::rss::situation::VehicleState::operator==
bool operator==(const VehicleState &other) const
standard comparison operator
Definition: VehicleState.hpp:108
ad::rss::situation::VehicleState::operator=
VehicleState & operator=(const VehicleState &other)=default
standard assignment operator
RssDynamics.hpp
ad::rss::situation::VelocityRange
DataType VelocityRange.
Definition: VelocityRange.hpp:43
ad::rss::situation::VehicleState::objectState
::ad::rss::world::ObjectState objectState
Definition: VehicleState.hpp:168