ad_rss
generated
include
ad
rss
state
ProperResponseValidInputRange.hpp
Go to the documentation of this file.
1
/*
2
* ----------------- BEGIN LICENSE BLOCK ---------------------------------
3
*
4
* Copyright (C) 2018-2022 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/geometry/HeadingRangeVectorValidInputRange.hpp"
23
#include "
ad/rss/state/AccelerationRestrictionValidInputRange.hpp
"
24
#include "
ad/rss/state/LateralResponseValidInputRange.hpp
"
25
#include "
ad/rss/state/LongitudinalResponseValidInputRange.hpp
"
26
#include "
ad/rss/state/ProperResponse.hpp
"
27
#include "
ad/rss/state/UnstructuredConstellationResponseValidInputRange.hpp
"
28
#include "
ad/rss/world/ObjectIdVectorValidInputRange.hpp
"
29
#include "spdlog/fmt/ostr.h"
30
#include "spdlog/spdlog.h"
31
43
inline
bool
withinValidInputRange
(::
ad::rss::state::ProperResponse
const
&input,
bool
const
logErrors =
true
)
44
{
45
// check for generic member input ranges
46
bool
inValidInputRange =
true
;
47
inValidInputRange =
withinValidInputRange
(input.
dangerous_objects
, logErrors)
48
&&
withinValidInputRange
(input.
longitudinal_response
, logErrors)
49
&&
withinValidInputRange
(input.
lateral_response_right
, logErrors)
50
&&
withinValidInputRange
(input.
lateral_response_left
, logErrors)
51
&&
withinValidInputRange
(input.
heading_ranges
, logErrors)
52
&&
withinValidInputRange
(input.
acceleration_restrictions
, logErrors)
53
&&
withinValidInputRange
(input.
unstructured_constellation_response
, logErrors);
54
if
(!inValidInputRange && logErrors)
55
{
56
spdlog::error(
"withinValidInputRange(::ad::rss::state::ProperResponse)>> {} has invalid member"
,
57
input);
// LCOV_EXCL_BR_LINE
58
}
59
60
// check for individual input ranges
61
if
(inValidInputRange)
62
{
63
inValidInputRange = (
::ad::rss::world::TimeIndex
(1) <= input.
time_index
);
64
if
(!inValidInputRange && logErrors)
65
{
66
spdlog::error(
67
"withinValidInputRange(::ad::rss::state::ProperResponse)>> {} element {} out of valid input range [{}, {}]"
,
68
input,
69
input.
time_index
,
70
::
ad::rss::world::TimeIndex
(1),
71
"Undefined"
);
// LCOV_EXCL_BR_LINE
72
}
73
}
74
75
return
inValidInputRange;
76
}
AccelerationRestrictionValidInputRange.hpp
LateralResponseValidInputRange.hpp
LongitudinalResponseValidInputRange.hpp
ObjectIdVectorValidInputRange.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::state::ProperResponse const &input, bool const logErrors=true)
check if the given ProperResponse is within valid input range
Definition:
ProperResponseValidInputRange.hpp:43
ProperResponse.hpp
UnstructuredConstellationResponseValidInputRange.hpp
ad::rss::world::TimeIndex
uint64_t TimeIndex
DataType TimeIndex.
Definition:
TimeIndex.hpp:39
ad::rss::state::ProperResponse
DataType ProperResponse.
Definition:
ProperResponse.hpp:50
ad::rss::state::ProperResponse::acceleration_restrictions
::ad::rss::state::AccelerationRestriction acceleration_restrictions
Definition:
ProperResponse.hpp:170
ad::rss::state::ProperResponse::longitudinal_response
::ad::rss::state::LongitudinalResponse longitudinal_response
Definition:
ProperResponse.hpp:149
ad::rss::state::ProperResponse::time_index
::ad::rss::world::TimeIndex time_index
Definition:
ProperResponse.hpp:133
ad::rss::state::ProperResponse::lateral_response_right
::ad::rss::state::LateralResponse lateral_response_right
Definition:
ProperResponse.hpp:154
ad::rss::state::ProperResponse::dangerous_objects
::ad::rss::world::ObjectIdVector dangerous_objects
Definition:
ProperResponse.hpp:144
ad::rss::state::ProperResponse::lateral_response_left
::ad::rss::state::LateralResponse lateral_response_left
Definition:
ProperResponse.hpp:159
ad::rss::state::ProperResponse::heading_ranges
::ad::geometry::HeadingRangeVector heading_ranges
Definition:
ProperResponse.hpp:165
ad::rss::state::ProperResponse::unstructured_constellation_response
::ad::rss::state::UnstructuredConstellationResponse unstructured_constellation_response
Definition:
ProperResponse.hpp:175
Generated by
1.9.1