ad_rss
RssStateEvaluatorValidInputRange.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>
23 #include "spdlog/fmt/ostr.h"
24 #include "spdlog/spdlog.h"
25 
36 inline bool withinValidInputRange(::ad::rss::state::RssStateEvaluator const &input, bool const logErrors = true)
37 {
38  bool inValidInputRange = (input == ::ad::rss::state::RssStateEvaluator::None)
40  || (input == ::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirection)
42  || (input == ::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionOtherInFront)
44  || (input == ::ad::rss::state::RssStateEvaluator::IntersectionOtherPriorityEgoAbleToStop)
46  || (input == ::ad::rss::state::RssStateEvaluator::IntersectionEgoInFront)
48  || (input == ::ad::rss::state::RssStateEvaluator::IntersectionOverlap);
49  if (!inValidInputRange && logErrors)
50  {
51  spdlog::error("withinValidInputRange(::ad::rss::state::RssStateEvaluator)>> {}, raw value: {} ",
52  input,
53  static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
54  }
55  return inValidInputRange;
56 }
ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirectionEgoCorrectLane
@ LongitudinalDistanceOppositeDirectionEgoCorrectLane
ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionEgoFront
@ LongitudinalDistanceSameDirectionEgoFront
RssStateEvaluator.hpp
ad::rss::state::RssStateEvaluator::LateralDistance
@ LateralDistance
ad::rss::state::RssStateEvaluator
RssStateEvaluator
DataType RssStateEvaluator.
Definition: RssStateEvaluator.hpp:41
withinValidInputRange
bool withinValidInputRange(::ad::rss::state::RssStateEvaluator const &input, bool const logErrors=true)
check if the given RssStateEvaluator is within valid input range
Definition: RssStateEvaluatorValidInputRange.hpp:36
ad::rss::state::RssStateEvaluator::IntersectionEgoPriorityOtherAbleToStop
@ IntersectionEgoPriorityOtherAbleToStop
ad::rss::state::RssStateEvaluator::IntersectionOtherInFront
@ IntersectionOtherInFront