Compute Graph Framework SDK Reference  5.16
dwCameraNode.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) 2018-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_SENSORS_DWCAMERANODE_DWCAMERANODE_HPP_
32#define DWFRAMEWORK_DWNODES_SENSORS_DWCAMERANODE_DWCAMERANODE_HPP_
33
34#include <dw/sensors/Sensors.h>
35#include <dw/sensors/camera/Camera.h>
36#include <dwcgf/node/Node.hpp>
39#include <dwcgf/pass/Pass.hpp>
41#include <dwcgf/port/Port.hpp>
43#include <dwframework/dwnodes/common/channelpackets/Image.hpp>
44#include <dwframework/dwnodes/common/channelpackets/SelfCalibrationTypes.hpp>
45#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
46#include <dwframework/dwnodes/common/channelpackets/Sensors.hpp>
47
48namespace dw
49{
50namespace framework
51{
52
53class dwCameraNodeImpl;
54
59{
60 char8_t const* sensorName;
61 cudaStream_t cudaStream;
63 dwConstRigHandle_t rig;
64 dwSALHandle_t sal;
65 FixedString<32> frameSkipMask;
66};
67
72{
73public:
74 // TODO(csketch): FP -- This is used when the logger is called and not just at assignment.
75 // coverity[autosar_cpp14_a0_1_1_violation] FP: nvbugs/2980283
76 // coverity[autosar_cpp14_m0_1_4_violation] FP: nvbugs/2980283
77 static constexpr char8_t LOG_TAG[]{"dwCameraNode"};
78
79 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
80 static constexpr auto describeInputPorts()
81 {
82 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
83 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
85 DW_DESCRIBE_PORT(dwCalibratedExtrinsics, "SENSOR_EXTRINSICS"_sv),
86 DW_DESCRIBE_PORT(dwTime_t, "VIRTUAL_SYNC_TIME"_sv));
87 };
88 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
89 static constexpr auto describeOutputPorts()
90 {
91 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
92 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
94 DW_DESCRIBE_PORT(dwSensorNodeProperties, "SENSOR_PROPERTIES"_sv),
95 DW_DESCRIBE_PORT(dwCameraIntrinsics, "INTRINSICS_EEPROM"_sv),
96 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE_NATIVE_RAW"_sv),
97 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE_NATIVE_PROCESSED"_sv),
98 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE_PROCESSED_RGBA"_sv),
99 DW_DESCRIBE_PORT(dwTime_t, "IMAGE_TIMESTAMP"_sv),
100 DW_DESCRIBE_PORT(dwTime_t, "NEXT_IMAGE_TIMESTAMP"_sv),
101 DW_DESCRIBE_PORT(dwSensorStats, "SENSOR_STATS"_sv),
102 DW_DESCRIBE_PORT(dwSensorTsAndID, "IMAGE_TIMESTAMP_AND_ID"_sv));
103 };
104
105 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
106 static constexpr auto describePasses()
107 {
109 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
110 describePass(StringView{"RAW_OUTPUT"}, DW_PROCESSOR_TYPE_GPU),
111 describePass(StringView{"PROCESSED_OUTPUT"}, DW_PROCESSOR_TYPE_GPU),
112 describePass(StringView{"PROCESSED_RGBA_OUTPUT"}, DW_PROCESSOR_TYPE_GPU),
113 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
114 };
115
116 dwSensorType getSensorType() const
117 {
118 return DW_SENSOR_CAMERA;
119 }
120
121 dwStatus getImageProperties(dwImageProperties* prop, dwCameraOutputType type);
122 dwStatus getCameraProperties(dwCameraProperties* prop);
123
124 static std::unique_ptr<dwCameraNode> create(ParameterProvider& provider);
125
126 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
127 static constexpr auto describeParameters()
128 {
129 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
130 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
132 describeConstructorArgument<dwCameraNodeParams>(
134 const char*,
136 "cameraIndex"_sv,
139 cudaStream_t,
140 "streamIndex"_sv,
143 bool,
144 "useEEPROMIntrinsics"_sv,
147 dwConstRigHandle_t,
150 dwSALHandle_t,
153 dw::core::FixedString<32>,
154 "frameSkipMask"_sv,
156 describeConstructorArgument<dwContextHandle_t>(
158 dwContextHandle_t)));
159 }
160
162 const dwContextHandle_t ctx);
163
164 // constructors with dwSensorParams
165 dwCameraNode(const dwSensorParams& params,
166 cudaStream_t cudaStream,
167 dwSALHandle_t sal,
168 dwContextHandle_t ctx);
169 dwCameraNode(const char* sensorName,
170 dwConstRigHandle_t rigHandle,
171 dwSALHandle_t sal,
172 dwContextHandle_t ctx,
173 const FixedString<32>& frameSkipMask);
174 dwCameraNode(const dwSensorParams& params,
175 dwSALHandle_t sal,
176 dwContextHandle_t ctx);
177};
178}
179}
180#endif // DWFRAMEWORK_DWNODES_SENSORS_DWCAMERANODE_DWCAMERANODE_HPP_
#define DW_DESCRIBE_INDEX_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, args...)
#define DW_DESCRIBE_INDEX_PARAMETER(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.
static constexpr auto describeInputPorts()
static constexpr auto describeOutputPorts()
static constexpr auto describePasses()
dwStatus getImageProperties(dwImageProperties *prop, dwCameraOutputType type)
static constexpr char8_t LOG_TAG[]
dwSensorType getSensorType() const
dwCameraNode(const dwSensorParams &params, cudaStream_t cudaStream, dwSALHandle_t sal, dwContextHandle_t ctx)
dwCameraNode(const char *sensorName, dwConstRigHandle_t rigHandle, dwSALHandle_t sal, dwContextHandle_t ctx, const FixedString< 32 > &frameSkipMask)
dwCameraNode(dwCameraNodeParams const &params, const dwContextHandle_t ctx)
static constexpr auto describeParameters()
dwCameraNode(const dwSensorParams &params, dwSALHandle_t sal, dwContextHandle_t ctx)
static std::unique_ptr< dwCameraNode > create(ParameterProvider &provider)
dwStatus getCameraProperties(dwCameraProperties *prop)
constexpr std::tuple describeConstructorArguments()
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
Construction parameters for dwCameraNode.
Definition: Buffer.hpp:40