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