Compute Graph Framework SDK Reference  5.16
dwSelfCalibrationCameraNode.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) 2022-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_SELFCALIBRATION_DWSELFCALIBRATIONCAMERANODE_DWSELFCALIBRATIONCAMERANODE_HPP_
32#define DWFRAMEWORK_DWNODES_SELFCALIBRATION_DWSELFCALIBRATIONCAMERANODE_DWSELFCALIBRATIONCAMERANODE_HPP_
33
34#include <dw/calibration/cameramodel/CameraModel.h>
35#include <dw/calibration/engine/common/SelfCalibrationCameraDiagnostics.h>
37#include <dwcgf/node/Node.hpp>
41#include <dwcgf/port/Port.hpp>
43#include <dwframework/dwnodes/common/channelpackets/EgomotionState.hpp>
44#include <dwframework/dwnodes/common/channelpackets/FeatureList.hpp>
45#include <dwframework/dwnodes/common/channelpackets/SelfCalibrationTypes.hpp>
46#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
47#include <dwframework/dwnodes/common/channelpackets/VehicleIOValStructures.hpp>
48#include <dwframework/dwnodes/common/SelfCalibrationTypes.hpp>
49#include <dwframework/dwnodes/selfcalibration/common/NodeCommonParams.hpp>
50
51namespace dw
52{
53namespace framework
54{
55
60{
61 dwConstRigHandle_t rigHandle;
62 // TODO(AVC-2389): Rename to cameraIndex, consider changing to uint32_t
63 size_t sensorIndex;
65 uint32_t channelFifoSize;
66 dwSelfCalibrationNodeCameraParams cameraParams;
68 dw::core::FixedString<64> calibrationSaveFileSuffix;
72 cudaStream_t cudaStream;
73 // This is a WAR to resolve the issue seen in the development of multi-process RoadRunner. Details of the issue is available: https://nvbugs/3991262
75};
76
83{
84public:
85 // TODO(csketch): FP -- This is used when the logger is called and not just at assignment.
86 // coverity[autosar_cpp14_a0_1_1_violation] FP: nvbugs/2980283
87 // coverity[autosar_cpp14_m0_1_4_violation] FP: nvbugs/2980283
88 static constexpr char8_t LOG_TAG[]{"dwSelfCalibrationCameraNode"};
89
90 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
91 static constexpr auto describeInputPorts()
92 {
93 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
94 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
96 DW_DESCRIBE_PORT(dwEgomotionStateHandle_t, "EGOMOTION_STATE_ODO_IMU"_sv, PortBinding::REQUIRED),
97 DW_DESCRIBE_PORT(dwVehicleIONonSafetyState, "VEHICLE_IO_NON_SAFETY_STATE"_sv, PortBinding::REQUIRED),
98 DW_DESCRIBE_PORT(dwFeatureHistoryArray, "CAMERA_FEATURE_DETECTION"_sv, PortBinding::REQUIRED),
99 DW_DESCRIBE_PORT(dwTime_t, "CAMERA_TIMESTAMP"_sv, PortBinding::REQUIRED),
100 DW_DESCRIBE_PORT(dwCameraIntrinsics, "CAMERA_INTRINSICS"_sv, PortBinding::REQUIRED),
101 DW_DESCRIBE_PORT(bool, "SERVICE_CALIB_ENABLE"_sv, PortBinding::OPTIONAL));
102 };
103
104 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
105 static constexpr auto describeOutputPorts()
106 {
107 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
108 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
110 DW_DESCRIBE_PORT(dwCalibratedExtrinsics, "CAMERA_EXTRINSICS"_sv, PortBinding::REQUIRED),
111 DW_DESCRIBE_PORT(bool, "SERVICE_CALIB_ACTIVE"_sv, PortBinding::OPTIONAL),
112 DW_DESCRIBE_PORT(dwSelfCalibrationCameraDiagnostics, "ROADCAST_SELFCALIBRATION_CAMERA_DIAGNOSTICS"_sv, PortBinding::OPTIONAL),
113 DW_DESCRIBE_PORT(dwCameraTwoViewTransformation, "CAMERA_TWO_VIEW_TRANSFORMATION"_sv, PortBinding::OPTIONAL));
114 }
115
116 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
117 static constexpr auto describePasses()
118 {
120 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
121 describePass(StringView{"PROCESS_NONCAMERA"}, DW_PROCESSOR_TYPE_CPU),
122 describePass(StringView{"PROCESS_CAMERA_GPU_ASYNC"}, DW_PROCESSOR_TYPE_GPU),
123 describePass(StringView{"PROCESS_CAMERA_CPU_SYNC"}, DW_PROCESSOR_TYPE_CPU),
124 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
125 }
126
127 static std::unique_ptr<dwSelfCalibrationCameraNode> create(ParameterProvider& provider);
128
129 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
130 static constexpr auto describeParameters()
131 {
132 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
133 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
135 describeConstructorArgument<dwSelfCalibrationCameraNodeParams>(
137 dwConstRigHandle_t,
140 size_t,
141 "sensorIndex"_sv,
144 bool,
145 "enableCalibration"_sv,
148 uint32_t,
149 "cameraCalibrationMethod"_sv,
150 &dwSelfCalibrationCameraNodeParams::cameraParams, &dwSelfCalibrationNodeCameraParams::calibrationMethod),
152 uint32_t,
153 "cameraCalibrationSignals"_sv,
154 &dwSelfCalibrationCameraNodeParams::cameraParams, &dwSelfCalibrationNodeCameraParams::calibrationSignals),
156 float32_t,
157 "rotationHistogramRangeDeg"_sv,
158 &dwSelfCalibrationCameraNodeParams::cameraParams, &dwSelfCalibrationNodeCameraParams::rotationHistogramRangeDeg),
160 uint32_t,
161 "channelFifoSize"_sv,
164 char8_t const*,
168 dw::core::FixedString<64>,
169 "calibrationSaveFileSuffix"_sv,
172 bool,
173 "loadStateOnStartup"_sv,
178 cudaStream_t,
179 "cameraSensorStreamIndex"_sv,
182 dwTime_t,
183 "nvSciChannelWaitTimeUs"_sv,
184 0,
186 describeConstructorArgument<dwContextHandle_t>(
188 dwContextHandle_t)));
189 }
190
191 dwSelfCalibrationCameraNode(dwSelfCalibrationCameraNodeParams const& param, dwContextHandle_t const ctx);
192};
193
194} // namespace framework
195} // namespace dw
196
197#endif // DWFRAMEWORK_DWNODES_SELFCALIBRATION_DWSELFCALIBRATIONCAMERANODE_DWSELFCALIBRATIONCAMERANODE_HPP_
#define DW_DESCRIBE_INDEX_PARAMETER(TYPE_NAME, args...)
#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...)
The interface to access parameter values identified by name and/or (semantic) type.
This node computes the camera's extrinsic properties (rotation+translation) with respect to the confi...
dwSelfCalibrationCameraNode(dwSelfCalibrationCameraNodeParams const &param, dwContextHandle_t const ctx)
static std::unique_ptr< dwSelfCalibrationCameraNode > create(ParameterProvider &provider)
constexpr std::tuple describeConstructorArguments()
char8_t const * calibrationOutputFileName
Output path where calibration overlay will be written, used to determine the location where calibrati...
dw::core::FixedString< 64 > calibrationSaveFileSuffix
Output file suffix.
size_t sensorIndex
Sensor type index (e.g. camera [0-12]), provided as parameter.
uint32_t channelFifoSize
Size of the input channel FIFO queues (must be >0)
cudaStream_t cudaStream
CUDA stream used for GPU computations.
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
bool enableCalibration
Flag to enable and disable calibration.
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
uint64_t stateWriteTimerPeriodInCycles
How often to serialize in node pass cycles. 0 means turn off serialization.
bool loadStateOnStartup
Flag to enable loading of stored calibration state on startup.
uint64_t stateWriteTimerOffsetInCycles
Offset, in cycles, for the write counter. The intention is to allow to delay the first write (and sub...
dwSelfCalibrationNodeCameraParams cameraParams
Camera calibration parameters.
Parameters for dwSelfCalibrationCameraNode.
Definition: Buffer.hpp:40