ad_rss
ObjectState.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/Angle.hpp"
25 #include "ad/physics/AngularVelocity.hpp"
26 #include "ad/physics/Dimension2D.hpp"
27 #include "ad/physics/Distance2D.hpp"
28 #include "ad/physics/Speed.hpp"
32 namespace ad {
36 namespace rss {
40 namespace world {
41 
52 {
56  typedef std::shared_ptr<ObjectState> Ptr;
57 
61  typedef std::shared_ptr<ObjectState const> ConstPtr;
62 
66  ObjectState() = default;
67 
71  ~ObjectState() = default;
72 
76  ObjectState(const ObjectState &other) = default;
77 
81  ObjectState(ObjectState &&other) = default;
82 
90  ObjectState &operator=(const ObjectState &other) = default;
91 
99  ObjectState &operator=(ObjectState &&other) = default;
100 
108  bool operator==(const ObjectState &other) const
109  {
110  return (yaw == other.yaw) && (dimension == other.dimension) && (yawRate == other.yawRate)
111  && (centerPoint == other.centerPoint) && (speed == other.speed) && (steeringAngle == other.steeringAngle);
112  }
113 
121  bool operator!=(const ObjectState &other) const
122  {
123  return !operator==(other);
124  }
125 
129  ::ad::physics::Angle yaw;
130 
134  ::ad::physics::Dimension2D dimension;
135 
139  ::ad::physics::AngularVelocity yawRate;
140 
144  ::ad::physics::Distance2D centerPoint;
145 
149  ::ad::physics::Speed speed;
150 
154  ::ad::physics::Angle steeringAngle;
155 };
156 
157 } // namespace world
158 } // namespace rss
159 } // namespace ad
160 
164 #ifndef GEN_GUARD_AD_RSS_WORLD_OBJECTSTATE
165 #define GEN_GUARD_AD_RSS_WORLD_OBJECTSTATE
166 
169 namespace ad {
173 namespace rss {
177 namespace world {
178 
188 inline std::ostream &operator<<(std::ostream &os, ObjectState const &_value)
189 {
190  os << "ObjectState(";
191  os << "yaw:";
192  os << _value.yaw;
193  os << ",";
194  os << "dimension:";
195  os << _value.dimension;
196  os << ",";
197  os << "yawRate:";
198  os << _value.yawRate;
199  os << ",";
200  os << "centerPoint:";
201  os << _value.centerPoint;
202  os << ",";
203  os << "speed:";
204  os << _value.speed;
205  os << ",";
206  os << "steeringAngle:";
207  os << _value.steeringAngle;
208  os << ")";
209  return os;
210 }
211 
212 } // namespace world
213 } // namespace rss
214 } // namespace ad
215 
216 namespace std {
220 inline std::string to_string(::ad::rss::world::ObjectState const &value)
221 {
222  stringstream sstream;
223  sstream << value;
224  return sstream.str();
225 }
226 } // namespace std
227 #endif // GEN_GUARD_AD_RSS_WORLD_OBJECTSTATE
ad::rss::world::ObjectState::ConstPtr
std::shared_ptr< ObjectState const > ConstPtr
Smart pointer on constant ObjectState.
Definition: ObjectState.hpp:61
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::world::ObjectState::centerPoint
::ad::physics::Distance2D centerPoint
Definition: ObjectState.hpp:144
ad::rss::world::ObjectState::yaw
::ad::physics::Angle yaw
Definition: ObjectState.hpp:129
ad::rss::world::ObjectState::operator==
bool operator==(const ObjectState &other) const
standard comparison operator
Definition: ObjectState.hpp:108
ad::rss::world::ObjectState::ObjectState
ObjectState()=default
standard constructor
ad::rss::world::ObjectState::steeringAngle
::ad::physics::Angle steeringAngle
Definition: ObjectState.hpp:154
ad::rss::world::ObjectState::dimension
::ad::physics::Dimension2D dimension
Definition: ObjectState.hpp:134
ad::rss::world::ObjectState::Ptr
std::shared_ptr< ObjectState > Ptr
Smart pointer on ObjectState.
Definition: ObjectState.hpp:56
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::world::operator<<
std::ostream & operator<<(std::ostream &os, LaneDrivingDirection const &value)
standard ostream operator
Definition: LaneDrivingDirection.hpp:132
ad::rss::world::ObjectState::~ObjectState
~ObjectState()=default
standard destructor
ad::rss::world::ObjectState
DataType ObjectState.
Definition: ObjectState.hpp:51
ad::rss::world::ObjectState::operator!=
bool operator!=(const ObjectState &other) const
standard comparison operator
Definition: ObjectState.hpp:121
ad::rss::world::ObjectState::speed
::ad::physics::Speed speed
Definition: ObjectState.hpp:149
ad::rss::world::ObjectState::yawRate
::ad::physics::AngularVelocity yawRate
Definition: ObjectState.hpp:139
ad::rss::world::ObjectState::operator=
ObjectState & operator=(const ObjectState &other)=default
standard assignment operator