ad_rss
AccelerationRestrictionValidInputRange.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/AccelerationRangeValidInputRange.hpp"
24 #include "spdlog/fmt/ostr.h"
25 #include "spdlog/spdlog.h"
26 
37 inline bool withinValidInputRange(::ad::rss::state::AccelerationRestriction const &input, bool const logErrors = true)
38 {
39  // check for generic member input ranges
40  bool inValidInputRange = true;
41  inValidInputRange = withinValidInputRange(input.lateralLeftRange, logErrors)
42  && withinValidInputRange(input.longitudinalRange, logErrors)
43  && withinValidInputRange(input.lateralRightRange, logErrors);
44  if (!inValidInputRange && logErrors)
45  {
46  spdlog::error("withinValidInputRange(::ad::rss::state::AccelerationRestriction)>> {} has invalid member",
47  input); // LCOV_EXCL_BR_LINE
48  }
49 
50  return inValidInputRange;
51 }
ad::rss::state::AccelerationRestriction::lateralRightRange
::ad::physics::AccelerationRange lateralRightRange
Definition: AccelerationRestriction.hpp:130
ad::rss::state::AccelerationRestriction::lateralLeftRange
::ad::physics::AccelerationRange lateralLeftRange
Definition: AccelerationRestriction.hpp:120
ad::rss::state::AccelerationRestriction
DataType AccelerationRestriction.
Definition: AccelerationRestriction.hpp:42
AccelerationRestriction.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::state::AccelerationRestriction const &input, bool const logErrors=true)
check if the given AccelerationRestriction is within valid input range
Definition: AccelerationRestrictionValidInputRange.hpp:37
ad::rss::state::AccelerationRestriction::longitudinalRange
::ad::physics::AccelerationRange longitudinalRange
Definition: AccelerationRestriction.hpp:125