ad_rss
TrajectoryVehicle.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2020-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: LGPL-2.1-only
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <ad/geometry/DebugDrawing.hpp>
15 #include <ad/geometry/GeometryOperation.hpp>
16 #include <ad/geometry/Types.hpp>
17 #include <ad/physics/RatioValue.hpp>
18 #include <algorithm>
19 #include <vector>
20 #include "ad/rss/core/Physics.hpp"
23 
27 namespace ad {
31 namespace rss {
35 namespace unstructured {
36 
41 {
42 public:
44  {
45  }
46 
57  ::ad::geometry::Polygon &brakePolygon,
58  ::ad::geometry::Polygon &continueForwardPolygon);
59 
60 private:
71  ad::physics::AngularVelocity calculateYawRate(ad::physics::AngularVelocity const &yaw_rate,
72  ad::physics::Duration const &timeInMovementUntilResponseTime,
73  ad::physics::AngularAcceleration const &maxYawRateChange,
74  ad::physics::RatioValue const &ratio) const;
75 
85  bool getResponseTimeTrajectoryPoints(core::RelativeObjectState const &vehicleState,
86  TrajectorySetStep &frontSide,
87  TrajectorySetStep &backSide) const;
88 
100  bool getResponseTimeTrajectoryPoints(core::RelativeObjectState const &vehicleState,
101  physics::Acceleration const &acceleration,
102  physics::RatioValue const &ratioDiff,
103  TrajectoryPoint::SpeedMode const &speedMode,
104  TrajectorySetStep &step) const;
105 
118  bool calculateTrajectoryPoint(TrajectoryPoint const &currentPoint,
119  world::RssDynamics const &dynamics,
120  ad::physics::Duration const &duration,
121  ad::physics::Acceleration const &acceleration,
122  ad::physics::RatioValue const &yawRateChangeRatio,
123  TrajectoryPoint &resultTrajectoryPoint) const;
124 
135  bool calculateTrajectoryPointOnCircle(TrajectoryPoint &currentPoint,
136  physics::Acceleration const &acceleration,
137  physics::Duration const &duration,
138  ::ad::rss::world::RssDynamics const &dynamics) const;
139 
149  bool getTimeInMovement(ad::physics::Speed const &speed,
150  ad::physics::Acceleration const &acceleration,
151  ad::physics::Duration &timeInMovement) const;
152 
166  bool calculateBrake(core::RelativeObjectState const &vehicleState,
167  ad::physics::Duration const &timeAfterResponseTimeSpeedMax,
168  TrajectorySetStep const &responseTimeFrontSide,
169  ad::physics::Duration const &timeAfterResponseTimeSpeedMin,
170  TrajectorySetStep const &responseTimeBackSide,
171  ::ad::geometry::Polygon &resultPolygon,
172  TrajectorySetStepVehicleLocation &brakeMinStepVehicleLocation) const;
173 
186  bool calculateContinueForward(core::RelativeObjectState const &vehicleState,
187  physics::Duration const &timeAfterResponseTime,
188  TrajectorySetStep const &responseTimeFrontSide,
189  ::ad::geometry::Polygon const &brakePolygon,
190  TrajectorySetStepVehicleLocation const &brakeMinStepVehicleLocation,
191  ::ad::geometry::Polygon &resultPolygon) const;
192 
203  bool calculateTrajectorySetStepOnCircle(core::RelativeObjectState const &vehicleState,
204  physics::Duration const &timeAfterResponseTime,
205  physics::Acceleration const &acceleration,
206  TrajectorySetStep &step) const;
207 };
208 
209 } // namespace unstructured
210 } // namespace rss
211 } // namespace ad
Calculates the trajectory sets of a vehicle.
Definition: TrajectoryVehicle.hpp:41
bool calculateTrajectorySets(core::RelativeObjectState const &vehicleState, ::ad::geometry::Polygon &brakePolygon, ::ad::geometry::Polygon &continueForwardPolygon)
Calculate the trajectory sets for braking and continue forward behavior.
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType RelativeObjectState.
Definition: RelativeObjectState.hpp:48
a point of a trajectory
Definition: TrajectoryCommon.hpp:49
Definition: TrajectoryCommon.hpp:125
DataType RssDynamics.
Definition: RssDynamics.hpp:51