ad_rss
generated
include
ad
rss
state
RssStateSnapshotValidInputRange.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/rss/state/RssStateSnapshot.hpp
"
23
#include "
ad/rss/state/RssStateVectorValidInputRange.hpp
"
24
#include "
ad/rss/state/UnstructuredConstellationStateInformationValidInputRange.hpp
"
25
#include "
ad/rss/world/RssDynamicsValidInputRange.hpp
"
26
#include "spdlog/fmt/ostr.h"
27
#include "spdlog/spdlog.h"
28
40
inline
bool
withinValidInputRange
(::
ad::rss::state::RssStateSnapshot
const
&input,
bool
const
logErrors =
true
)
41
{
42
// check for generic member input ranges
43
bool
inValidInputRange =
true
;
44
inValidInputRange =
withinValidInputRange
(input.
default_ego_vehicle_rss_dynamics
, logErrors)
45
&&
withinValidInputRange
(input.
individual_responses
, logErrors)
46
&&
withinValidInputRange
(input.
unstructured_constellation_ego_information
, logErrors);
47
if
(!inValidInputRange && logErrors)
48
{
49
spdlog::error(
"withinValidInputRange(::ad::rss::state::RssStateSnapshot)>> {} has invalid member"
,
50
input);
// LCOV_EXCL_BR_LINE
51
}
52
53
// check for individual input ranges
54
if
(inValidInputRange)
55
{
56
inValidInputRange = (
::ad::rss::world::TimeIndex
(1) <= input.
time_index
);
57
if
(!inValidInputRange && logErrors)
58
{
59
spdlog::error(
60
"withinValidInputRange(::ad::rss::state::RssStateSnapshot)>> {} element {} out of valid input range [{}, {}]"
,
61
input,
62
input.
time_index
,
63
::
ad::rss::world::TimeIndex
(1),
64
"Undefined"
);
// LCOV_EXCL_BR_LINE
65
}
66
}
67
68
return
inValidInputRange;
69
}
RssDynamicsValidInputRange.hpp
withinValidInputRange
bool withinValidInputRange(::ad::rss::state::RssStateSnapshot const &input, bool const logErrors=true)
check if the given RssStateSnapshot is within valid input range
Definition:
RssStateSnapshotValidInputRange.hpp:40
RssStateSnapshot.hpp
RssStateVectorValidInputRange.hpp
UnstructuredConstellationStateInformationValidInputRange.hpp
ad::rss::world::TimeIndex
uint64_t TimeIndex
DataType TimeIndex.
Definition:
TimeIndex.hpp:39
ad::rss::state::RssStateSnapshot
DataType RssStateSnapshot.
Definition:
RssStateSnapshot.hpp:47
ad::rss::state::RssStateSnapshot::unstructured_constellation_ego_information
::ad::rss::state::UnstructuredConstellationStateInformation unstructured_constellation_ego_information
Definition:
RssStateSnapshot.hpp:146
ad::rss::state::RssStateSnapshot::time_index
::ad::rss::world::TimeIndex time_index
Definition:
RssStateSnapshot.hpp:128
ad::rss::state::RssStateSnapshot::individual_responses
::ad::rss::state::RssStateVector individual_responses
Definition:
RssStateSnapshot.hpp:141
ad::rss::state::RssStateSnapshot::default_ego_vehicle_rss_dynamics
::ad::rss::world::RssDynamics default_ego_vehicle_rss_dynamics
Definition:
RssStateSnapshot.hpp:136
Generated by
1.9.1