Compute Graph Framework SDK Reference  5.16
dwRigNode.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) 2020-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_DWRIGNODE_DWRIGNODE_HPP_
32#define DWFRAMEWORK_DWNODES_DWRIGNODE_DWRIGNODE_HPP_
33
34#include "dwRigNode_errorid.h"
35
36#include <dw/rig/Rig.h>
37#include <dwcgf/node/Node.hpp>
43#include <dwframework/dwnodes/common/channelpackets/SelfCalibrationTypes.hpp>
44#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
45
46namespace dw
47{
48namespace framework
49{
50
52{
53 dwRigHandle_t rigHandle;
54
56 char8_t const* rigOutputFileName;
57
60
63
64 // sensor type index
65 bool imuSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_IMUS];
66 std::uint32_t imuSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_IMUS];
67 bool cameraSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS];
68 std::uint32_t cameraSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS];
69 bool radarSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_RADARS];
70 std::uint32_t radarSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_RADARS];
71 bool lidarSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_LIDARS];
72 std::uint32_t lidarSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_LIDARS];
73
74 // sensor instance ids
75 uint32_t cameraInstanceIds[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS];
76 uint32_t radarInstanceIds[framework::SELF_CALIBRATION_NODE_MAX_RADARS];
77
78 // Always update camera intrinsics when set to true.
79 // Otherwise intrinsics in rig only get update when a signal is received in CAMERA_INTRINSICS_UPDATE.
80 bool forceCameraIntrinsicsUpdate[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS];
81
82 // periodic rig writing
83 // how often to serialize in node pass cycles. 0 means turn off serialization
85 // offset, in cycles, for the write counter. The intention is to allow to delay the
86 // first write (and subsequently other writes) so that a few cycles occur before
87 // serialization is attempted
88 // must be less than rigWriteTimerPeriodInCycles for serialization to occur.
90};
91
98{
99public:
100 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
101 static constexpr auto describeInputPorts()
102 {
103 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
104 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
106 DW_DESCRIBE_PORT(dwCalibratedExtrinsics, "IMU_EXTRINSICS"_sv, PortBinding::REQUIRED),
107 DW_DESCRIBE_PORT_ARRAY(dwCalibratedExtrinsics, framework::SELF_CALIBRATION_NODE_MAX_CAMERAS, "CAMERA_EXTRINSICS"_sv, PortBinding::REQUIRED),
108 DW_DESCRIBE_PORT_ARRAY(dwCalibratedExtrinsics, framework::SELF_CALIBRATION_NODE_MAX_RADARS, "RADAR_EXTRINSICS"_sv, PortBinding::REQUIRED),
109 DW_DESCRIBE_PORT_ARRAY(dwCalibratedExtrinsics, framework::SELF_CALIBRATION_NODE_MAX_LIDARS, "LIDAR_EXTRINSICS"_sv, PortBinding::REQUIRED),
110 DW_DESCRIBE_PORT(dwCalibratedWheelRadii, "WHEEL_RADII"_sv, PortBinding::REQUIRED),
111 DW_DESCRIBE_PORT(dwCalibratedSteeringProperties, "FRONT_STEERING_OFFSET"_sv, PortBinding::REQUIRED),
112 DW_DESCRIBE_PORT(dwCalibratedIMUIntrinsics, "IMU_INTRINSICS"_sv, PortBinding::OPTIONAL),
113 DW_DESCRIBE_PORT_ARRAY(dwCameraIntrinsics, framework::SELF_CALIBRATION_NODE_MAX_CAMERAS, "CAMERA_INTRINSICS"_sv, PortBinding::OPTIONAL),
114 DW_DESCRIBE_PORT_ARRAY(bool, framework::SELF_CALIBRATION_NODE_MAX_CAMERAS, "CAMERA_INTRINSICS_UPDATE"_sv, PortBinding::OPTIONAL),
115 DW_DESCRIBE_PORT(bool, "STORE"_sv, PortBinding::OPTIONAL));
116 };
117 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
118 static constexpr auto describeOutputPorts()
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
122 return describePortCollection();
123 };
124 // T
125 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
126 static constexpr auto describePasses()
127 {
129 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
130 describePass(StringView{"PROCESS"}, DW_PROCESSOR_TYPE_CPU),
131 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
132 };
133
134 static std::unique_ptr<dwRigNode> create(ParameterProvider const& provider);
135
136 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
137 static constexpr auto describeParameters()
138 {
139 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
140 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
142 describeConstructorArgument<dwRigNodeParams>(
144 dwRigHandle_t,
145 &dwRigNodeParams::rigHandle),
147 char8_t const*,
151 char8_t const*,
155 char8_t const*,
159 bool,
161 framework::SELF_CALIBRATION_NODE_MAX_IMUS,
164 uint32_t,
166 framework::SELF_CALIBRATION_NODE_MAX_IMUS,
169 bool,
171 framework::SELF_CALIBRATION_NODE_MAX_CAMERAS,
174 uint32_t,
176 framework::SELF_CALIBRATION_NODE_MAX_CAMERAS,
179 bool,
181 framework::SELF_CALIBRATION_NODE_MAX_RADARS,
184 uint32_t,
186 framework::SELF_CALIBRATION_NODE_MAX_RADARS,
189 bool,
191 framework::SELF_CALIBRATION_NODE_MAX_LIDARS,
194 uint32_t,
196 framework::SELF_CALIBRATION_NODE_MAX_LIDARS,
199 uint32_t,
201 framework::SELF_CALIBRATION_NODE_MAX_CAMERAS,
204 uint32_t,
206 framework::SELF_CALIBRATION_NODE_MAX_RADARS,
209 bool,
210 "forceCameraIntrinsicsUpdate",
211 std::array<bool, framework::SELF_CALIBRATION_NODE_MAX_CAMERAS>{false, false, false, false, false, false, false, false, false, false, false, false, false},
213 DW_DESCRIBE_PARAMETER_WITH_DEFAULT(uint64_t, "rigWriteTimerPeriodInCycles"_sv, 0, &dwRigNodeParams::rigWriteTimerPeriodInCycles),
214 DW_DESCRIBE_PARAMETER_WITH_DEFAULT(uint64_t, "rigWriteTimerOffsetInCycles"_sv, 0, &dwRigNodeParams::rigWriteTimerOffsetInCycles)),
215 describeConstructorArgument<dwContextHandle_t>(
217 dwContextHandle_t)));
218 };
219
220 dwRigNode(dwRigNodeParams const& params, dwContextHandle_t const ctx);
221 ~dwRigNode() override = default;
222 dwRigNode(const dwRigNode& other) = default;
223 dwRigNode(dwRigNode&& other) = default;
224 dwRigNode& operator=(const dwRigNode&) = default;
226
227 dwStatus preShutdown() override;
228};
229
230} /* namespace framework */
231} /* namespace dw */
232#endif // DWFRAMEWORK_DWNODES_DWRIGNODE_DWRIGNODE_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_ARRAY_PARAMETER_WITH_DEFAULT(TYPE_NAME, args...)
#define DW_DESCRIBE_UNNAMED_ARRAY_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, ARRAY_SIZE, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, NAME, args...)
#define DW_DESCRIBE_PORT_ARRAY(TYPE_NAME, ARRAYSIZE, NAME, args...)
The interface to access parameter values identified by name and/or (semantic) type.
dwRigNode receives extrinsic calibrations from sensors in the system, and maintains that state to upd...
Definition: dwRigNode.hpp:98
~dwRigNode() override=default
dwRigNode & operator=(dwRigNode &&)=default
dwRigNode & operator=(const dwRigNode &)=default
dwRigNode(dwRigNodeParams const &params, dwContextHandle_t const ctx)
static std::unique_ptr< dwRigNode > create(ParameterProvider const &provider)
dwRigNode(const dwRigNode &other)=default
dwStatus preShutdown() override
static constexpr auto describeInputPorts()
Definition: dwRigNode.hpp:101
static constexpr auto describeParameters()
Definition: dwRigNode.hpp:137
static constexpr auto describeOutputPorts()
Definition: dwRigNode.hpp:118
static constexpr auto describePasses()
Definition: dwRigNode.hpp:126
dwRigNode(dwRigNode &&other)=default
bool lidarSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_LIDARS]
Definition: dwRigNode.hpp:71
std::uint32_t radarSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_RADARS]
Definition: dwRigNode.hpp:70
constexpr std::tuple describeConstructorArguments()
char8_t const * rigOutputFileName
Definition: dwRigNode.hpp:56
bool forceCameraIntrinsicsUpdate[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS]
Definition: dwRigNode.hpp:80
bool radarSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_RADARS]
Definition: dwRigNode.hpp:69
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
bool cameraSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS]
Definition: dwRigNode.hpp:67
std::uint32_t lidarSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_LIDARS]
Definition: dwRigNode.hpp:72
char8_t const * calibrationOutputFileName
Definition: dwRigNode.hpp:59
uint32_t cameraInstanceIds[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS]
Definition: dwRigNode.hpp:75
std::uint32_t imuSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_IMUS]
Definition: dwRigNode.hpp:66
std::uint32_t cameraSensorRigIndices[framework::SELF_CALIBRATION_NODE_MAX_CAMERAS]
Definition: dwRigNode.hpp:68
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
uint64_t rigWriteTimerPeriodInCycles
Definition: dwRigNode.hpp:84
char8_t const * calibrationOverlayFileName
Definition: dwRigNode.hpp:62
uint64_t rigWriteTimerOffsetInCycles
Definition: dwRigNode.hpp:89
bool imuSensorEnabled[framework::SELF_CALIBRATION_NODE_MAX_IMUS]
Definition: dwRigNode.hpp:65
uint32_t radarInstanceIds[framework::SELF_CALIBRATION_NODE_MAX_RADARS]
Definition: dwRigNode.hpp:76
dwRigNodeParams { dwRigHandle_t rigHandle dwRigNodeParams
Definition: dwRigNode.hpp:53
Definition: Buffer.hpp:40