ad_rss
VelocityRangeValidInputRange.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/SpeedRangeValidInputRange.hpp"
24 #include "spdlog/fmt/ostr.h"
25 #include "spdlog/spdlog.h"
26 
37 inline bool withinValidInputRange(::ad::rss::situation::VelocityRange const &input, bool const logErrors = true)
38 {
39  // check for generic member input ranges
40  bool inValidInputRange = true;
41  inValidInputRange
42  = withinValidInputRange(input.speedLon, logErrors) && withinValidInputRange(input.speedLat, logErrors);
43  if (!inValidInputRange && logErrors)
44  {
45  spdlog::error("withinValidInputRange(::ad::rss::situation::VelocityRange)>> {} has invalid member",
46  input); // LCOV_EXCL_BR_LINE
47  }
48 
49  return inValidInputRange;
50 }
VelocityRange.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::situation::VelocityRange const &input, bool const logErrors=true)
check if the given VelocityRange is within valid input range
Definition: VelocityRangeValidInputRange.hpp:37
ad::rss::situation::VelocityRange::speedLat
::ad::physics::SpeedRange speedLat
Definition: VelocityRange.hpp:129
ad::rss::situation::VelocityRange::speedLon
::ad::physics::SpeedRange speedLon
Definition: VelocityRange.hpp:122
ad::rss::situation::VelocityRange
DataType VelocityRange.
Definition: VelocityRange.hpp:43