Compute Graph Framework SDK Reference  5.16
dwGlobalEgomotionNode.hpp
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
31#ifndef DWFRAMEWORK_DWNODES_EGOMOTION_DWGLOBALEGOMOTIONNODE_DWGLOBALEGOMOTIONNODE_HPP_
32#define DWFRAMEWORK_DWNODES_EGOMOTION_DWGLOBALEGOMOTIONNODE_DWGLOBALEGOMOTIONNODE_HPP_
33
34#include <dw/egomotion/base/Egomotion.h>
35#include <dw/egomotion/global/GlobalEgomotion.h>
36#include <dw/egomotion/global/GlobalEgomotionSerialization.h>
37#include <dw/roadcast/base_types/RoadCastPacketTypes.hpp>
39#include <dwcgf/node/Node.hpp>
42#include <dwcgf/pass/Pass.hpp>
44#include <dwcgf/port/Port.hpp>
46#include <dwframework/dwnodes/common/GlobalEgomotionCommonTypes.hpp>
47#include <dwframework/dwnodes/common/channelpackets/EgomotionState.hpp>
48#include <dwframework/dwnodes/common/channelpackets/GPS.hpp>
49#include <dwframework/dwnodes/common/channelpackets/GlobalEgomotionCommonTypes.hpp>
50
51namespace dw
52{
53namespace framework
54{
55
57{
58 dwConstRigHandle_t rigHandle;
59 const char* gpsSensorName;
60 uint32_t historySize;
61
64};
65
79{
80public:
81 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
82 static constexpr auto describeInputPorts()
83 {
84 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
85 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
87 DW_DESCRIBE_PORT(dwGPSFrame, "GPS_FRAME"_sv),
88 DW_DESCRIBE_PORT(dwEgomotionStateHandle_t, "EGOMOTION_STATE"_sv),
89 DW_DESCRIBE_PORT(dwTime_t, "CONTEXT_TIMESTAMP"_sv));
90 };
91 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
92 static constexpr auto describeOutputPorts()
93 {
94 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
95 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
97 DW_DESCRIBE_PORT(dwGlobalEgomotionState, "GLOBAL_EGOMOTION"_sv),
98 DW_DESCRIBE_PORT(dwGlobalEgomotionResultPayload, "GLOBAL_EGOMOTION_RESULT_PAYLOAD"_sv));
99 };
100 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
101 static constexpr auto describePasses()
102 {
104 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
105 describePass(StringView{"ADD_GPS"}, DW_PROCESSOR_TYPE_CPU),
106 describePass(StringView{"ADD_RELATIVE_EGOMOTION"}, DW_PROCESSOR_TYPE_CPU),
107 describePass(StringView{"SEND_STATE"}, DW_PROCESSOR_TYPE_CPU),
108 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
109 };
110
111 static std::unique_ptr<dwGlobalEgomotionNode> create(ParameterProvider& provider);
112
115 const dwContextHandle_t ctx);
116
117 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
118 static constexpr auto describeParameters()
119 {
120 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
121 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
123 describeConstructorArgument<dwGlobalEgomotionNodeInitParams>(
125 dwConstRigHandle_t,
128 const char*,
132 uint32_t,
133 "historySize"_sv,
136 dwTime_t,
137 "nvSciChannelWaitTimeUs"_sv,
138 0,
140 describeConstructorArgument<dwContextHandle_t>(
142 dwContextHandle_t)));
143 }
144
145 dwStatus preShutdown() override
146 {
147 // coverity[autosar_cpp14_a8_5_2_violation] FP: nvbugs/3904083
148 auto* preShutdownNode = dynamic_cast<IContainsPreShutdownAction*>(m_impl.get());
149 if (preShutdownNode)
150 {
151 return preShutdownNode->preShutdown();
152 }
153 return DW_NOT_SUPPORTED;
154 }
155};
156}
157}
158
159#endif // DWFRAMEWORK_DWNODES_EGOMOTION_DWGLOBALEGOMOTIONNODE_DWGLOBALEGOMOTIONNODE_HPP_
#define DW_DESCRIBE_PARAMETER_WITH_DEFAULT(TYPE_NAME, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, NAME, args...)
virtual dwStatus preShutdown()=0
actions to be taken before node shutdown
The interface to access parameter values identified by name and/or (semantic) type.
This node computes the global vehicle state and motion over time using signals from GPS and relative ...
dwGlobalEgomotionNode(const dwGlobalEgomotionNodeInitParams &params, const dwContextHandle_t ctx)
static std::unique_ptr< dwGlobalEgomotionNode > create(ParameterProvider &provider)
constexpr std::tuple describeConstructorArguments()
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
dwTime_t nvSciChannelWaitTimeUs
Wait time for nvSciChannel.
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
Definition: Buffer.hpp:40