Compute Graph Framework SDK Reference  5.10
Radar.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 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_COMMON_CHANNELPACKETS_RADAR_HPP_
32#define DWFRAMEWORK_DWNODES_COMMON_CHANNELPACKETS_RADAR_HPP_
33
34#include "ChannelPacketUtils.hpp"
35#include <dw/core/container/Span.hpp>
36#include <dw/sensors/radar/Radar.h>
37#include <dwcgf/Exception.hpp>
43#include <nvscibuf.h>
44
47
48namespace dw
49{
50namespace framework
51{
52
54// dwRadarScan packet for channel socket
56{
57public:
58 ChannelPacketRadarScan(const GenericData& specimen, dwContextHandle_t ctx);
59 ChannelPacketRadarScan(dwRadarScan& ref, dwContextHandle_t);
60 dwRadarScan* getFrame();
61 void setBufferSize(size_t bufferSize);
62 // Serializes the frame before transmission
63 size_t serialize() final;
64 // Deserializes the frame after transmission
65 void deserialize(size_t) final;
66
67private:
68 size_t getRadarDataSize(const dwRadarScan& radarScan);
69 dwRadarScan m_data{};
70 std::unique_ptr<uint8_t[]> m_scanData;
71 std::unique_ptr<uint8_t[]> m_scanDetectionMisc;
72 std::unique_ptr<uint8_t[]> m_scanDetectionStdDev;
73 std::unique_ptr<uint8_t[]> m_scanDetectionQuality;
74 std::unique_ptr<uint8_t[]> m_scanDetectionProbability;
75 std::unique_ptr<uint8_t[]> m_scanDetectionFFTPatch;
76};
77
79{
80private:
81 static constexpr uint32_t NUM_BUFFERS{1U};
82
83public:
85 uint32_t getNumBuffers() const final;
86 void fillNvSciBufAttributes(uint32_t /*bufferIndex*/, NvSciBufAttrList& attrList) const final;
87 void initializeFromNvSciBufObjs(dw::core::span<NvSciBufObj> bufs) final;
88 void pack() final;
89 void unpack() final;
91
92private:
93 void setPointers();
94
95 std::unique_ptr<Buffer> m_buffer;
96 dwRadarScan m_reference{};
97 dwRadarScan m_dispatch{};
98 dwRadarScan* m_header{};
99 size_t m_headerSize{};
100 size_t m_numReturns{};
101 size_t m_dataSize{};
102 size_t m_detectionMiscSize{};
103 size_t m_detectionStdDevSize{};
104 size_t m_detectionQualitySize{};
105 size_t m_detectionProbabilitySize{};
106 size_t m_detectionFFTPatchSize{};
107};
108
109} // namespace framework
110} // namespace dw
111
112#endif // DWFRAMEWORK_DWNODES_COMMON_CHANNELPACKETS_RADAR_HPP_
DWFRAMEWORK_DECLARE_PACKET_TYPE_POD(dwRadarProperties)
DWFRAMEWORK_DECLARE_PACKET_DWTYPE_RELATION_SIMPLE(dwRadarScan, DW_RADAR_SCAN)
ChannelPacketRadarScan(dwRadarScan &ref, dwContextHandle_t)
void setBufferSize(size_t bufferSize)
ChannelPacketRadarScan(const GenericData &specimen, dwContextHandle_t ctx)
GenericData getGenericData() final
void fillNvSciBufAttributes(uint32_t, NvSciBufAttrList &attrList) const final
RadarScanNvSciPacket(const GenericData &specimen)
uint32_t getNumBuffers() const final
void initializeFromNvSciBufObjs(dw::core::span< NvSciBufObj > bufs) final
Definition: Buffer.hpp:40