ad_rss
UnstructuredSettingsValidInputRange.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 <cmath>
21 #include <limits>
22 #include "ad/physics/AngleValidInputRange.hpp"
23 #include "ad/physics/AngularAccelerationValidInputRange.hpp"
24 #include "ad/physics/DistanceValidInputRange.hpp"
25 #include "ad/physics/DurationValidInputRange.hpp"
27 #include "spdlog/fmt/ostr.h"
28 #include "spdlog/spdlog.h"
29 
40 inline bool withinValidInputRange(::ad::rss::world::UnstructuredSettings const &input, bool const logErrors = true)
41 {
42  // check for generic member input ranges
43  bool inValidInputRange = true;
44  inValidInputRange = withinValidInputRange(input.pedestrianTurningRadius, logErrors)
45  && withinValidInputRange(input.driveAwayMaxAngle, logErrors)
46  && withinValidInputRange(input.vehicleYawRateChange, logErrors)
47  && withinValidInputRange(input.vehicleMinRadius, logErrors)
49  if (!inValidInputRange && logErrors)
50  {
51  spdlog::error("withinValidInputRange(::ad::rss::world::UnstructuredSettings)>> {} has invalid member",
52  input); // LCOV_EXCL_BR_LINE
53  }
54 
55  return inValidInputRange;
56 }
withinValidInputRange
bool withinValidInputRange(::ad::rss::world::UnstructuredSettings const &input, bool const logErrors=true)
check if the given UnstructuredSettings is within valid input range
Definition: UnstructuredSettingsValidInputRange.hpp:40
ad::rss::world::UnstructuredSettings::vehicleYawRateChange
::ad::physics::AngularAcceleration vehicleYawRateChange
Definition: UnstructuredSettings.hpp:156
ad::rss::world::UnstructuredSettings::vehicleMinRadius
::ad::physics::Distance vehicleMinRadius
Definition: UnstructuredSettings.hpp:161
ad::rss::world::UnstructuredSettings::pedestrianTurningRadius
::ad::physics::Distance pedestrianTurningRadius
Definition: UnstructuredSettings.hpp:143
ad::rss::world::UnstructuredSettings::vehicleTrajectoryCalculationStep
::ad::physics::Duration vehicleTrajectoryCalculationStep
Definition: UnstructuredSettings.hpp:169
UnstructuredSettings.hpp
ad::rss::world::UnstructuredSettings::driveAwayMaxAngle
::ad::physics::Angle driveAwayMaxAngle
Definition: UnstructuredSettings.hpp:150
ad::rss::world::UnstructuredSettings
DataType UnstructuredSettings.
Definition: UnstructuredSettings.hpp:47