Compute Graph Framework SDK Reference  5.12
dwVehicleStateNode.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_SENSORS_DWVEHICLESTATENODE_DWVEHICLESTATENODE_HPP_
32#define DWFRAMEWORK_DWNODES_SENSORS_DWVEHICLESTATENODE_DWVEHICLESTATENODE_HPP_
33
34#include "VehicleIOTypes.hpp"
35#include <dw/sensors/Sensors.h>
36#include <dw/sensors/canbus/CAN.h>
37#include <dw/sensors/data/Data.h>
38#include <dwcgf/node/Node.hpp>
42#include <dwcgf/pass/Pass.hpp>
44#include <dwcgf/port/Port.hpp>
47#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
48#include <dwframework/dwnodes/common/channelpackets/Sensors.hpp>
49#include <dwframework/dwnodes/common/channelpackets/VehicleIOLegacyStructures.hpp>
50#include <dwframework/dwnodes/common/channelpackets/VehicleIOValStructures.hpp>
51
52namespace dw
53{
54namespace framework
55{
56
58{
59 // Don't technically need these two params, but seems required for codegen to work
60 const char* sensorName;
61 dwConstRigHandle_t rigHandle;
62 FixedString<32> frameSkipMask;
63
64 // Mutually exlusive parameters. Can be made enum if GDL can support conditional statements to enable switchboards
69};
70
75{
76public:
77 // TODO(csketch): FP -- This is used when the logger is called and not just at assignment.
78 // coverity[autosar_cpp14_a0_1_1_violation] FP: nvbugs/2980283
79 // coverity[autosar_cpp14_m0_1_4_violation] FP: nvbugs/2980283
80 static constexpr char8_t LOG_TAG[]{"dwVehicleStateNode"};
81
82 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
83 static constexpr auto describeInputPorts()
84 {
85 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
86 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
88 DW_DESCRIBE_PORT(dwVehicleIOCommand, "VEHICLE_IO_COMMAND"_sv, PortBinding::REQUIRED),
89 DW_DESCRIBE_PORT(dwVehicleIOMiscCommand, "VEHICLE_IO_MISC_COMMAND"_sv),
90 DW_DESCRIBE_PORT(dwTime_t, "VIRTUAL_SYNC_TIME"_sv),
91 DW_DESCRIBE_PORT(dwVehicleIOState, "VEHICLE_IO_LEGACY_STATE"_sv),
92 DW_DESCRIBE_PORT(dwVehicleIOSafetyState, "VEHICLE_IO_SAFETY_STATE"_sv),
93 DW_DESCRIBE_PORT(dwVehicleIONonSafetyState, "VEHICLE_IO_NON_SAFETY_STATE"_sv),
94 DW_DESCRIBE_PORT(dwVehicleIOActuationFeedback, "VEHICLE_IO_ACTUATION_FEEDBACK"_sv));
95 };
96 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
97 static constexpr auto describeOutputPorts()
98 {
99 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
100 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
102 DW_DESCRIBE_PORT(dwSensorNodeRawData, "RAW_DATA"_sv),
103 DW_DESCRIBE_PORT(dwSensorNodeProperties, "SENSOR_PROPERTIES"_sv),
104 DW_DESCRIBE_PORT(dwVehicleIOState, "PROCESSED_DATA"_sv, PortBinding::REQUIRED),
105 DW_DESCRIBE_PORT(dwSensorTsAndID, "TIMESTAMP"_sv),
106 DW_DESCRIBE_PORT(dwTime_t, "NEXT_TIMESTAMP"_sv),
107 DW_DESCRIBE_PORT(dwVehicleIOSafetyState, "VEHICLE_IO_SAFETY_STATE"_sv, PortBinding::REQUIRED),
108 DW_DESCRIBE_PORT(dwVehicleIONonSafetyState, "VEHICLE_IO_NON_SAFETY_STATE"_sv, PortBinding::REQUIRED),
109 DW_DESCRIBE_PORT(dwVehicleIOActuationFeedback, "VEHICLE_IO_ACTUATION_FEEDBACK"_sv, PortBinding::REQUIRED),
110 DW_DESCRIBE_PORT(dwVehicleIOSafetyState, "VEHICLE_IO_SAFETY_STATE_EXTERNAL"_sv),
111 DW_DESCRIBE_PORT(dwVehicleIONonSafetyState, "VEHICLE_IO_NON_SAFETY_STATE_EXTERNAL"_sv),
112 DW_DESCRIBE_PORT(dwVehicleIOActuationFeedback, "VEHICLE_IO_ACTUATION_FEEDBACK_EXTERNAL"_sv));
113 };
114
115 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
116 static constexpr auto describePasses()
117 {
119 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
120 describePass(StringView{"RAW_OUTPUT"}, DW_PROCESSOR_TYPE_CPU),
121 describePass(StringView{"PROCESSED_OUTPUT"}, DW_PROCESSOR_TYPE_CPU),
122 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
123 };
124
125 dwSensorType getSensorType() const
126 {
127 return DW_SENSOR_CAN;
128 }
129
130 static std::unique_ptr<dwVehicleStateNode> create(ParameterProvider& provider);
131
132 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
133 static constexpr auto describeParameters()
134 {
135 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
136 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
137 return describeConstructorArguments<VehicleStateNodeParams, const char*, dwRigHandle_t, dwSALHandle_t, dwContextHandle_t>(
143 DW_DESCRIBE_PARAMETER(dw::core::FixedString<32>, "frameSkipMask"_sv, &VehicleStateNodeParams::frameSkipMask)),
146 const char*,
150 dwRigHandle_t)),
153 dwSALHandle_t)),
156 dwContextHandle_t)));
157 }
158
159 dwVehicleStateNode(const char* sensorName, dwConstRigHandle_t rigHandle,
160 dwSALHandle_t sal, dwContextHandle_t ctx, const FixedString<32>& frameSkipMask);
161 dwVehicleStateNode(VehicleStateNodeParams const& params, const char* sensorName, dwConstRigHandle_t rigHandle,
162 dwSALHandle_t sal, dwContextHandle_t ctx);
163 dwVehicleStateNode(const dwSensorParams& params,
164 dwSALHandle_t sal, dwContextHandle_t ctx);
165
166 dwStatus preShutdown() override;
167};
168}
169}
170#endif // DWFRAMEWORK_DWNODES_SENSORS_DWVEHICLESTATENODE_DWVEHICLESTATENODE_HPP_
#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, args...)
The interface to access parameter values identified by name and/or (semantic) type.
dwVehicleStateNode(const dwSensorParams &params, dwSALHandle_t sal, dwContextHandle_t ctx)
static std::unique_ptr< dwVehicleStateNode > create(ParameterProvider &provider)
static constexpr char8_t LOG_TAG[]
static constexpr auto describeOutputPorts()
dwVehicleStateNode(const char *sensorName, dwConstRigHandle_t rigHandle, dwSALHandle_t sal, dwContextHandle_t ctx, const FixedString< 32 > &frameSkipMask)
dwVehicleStateNode(VehicleStateNodeParams const &params, const char *sensorName, dwConstRigHandle_t rigHandle, dwSALHandle_t sal, dwContextHandle_t ctx)
static constexpr auto describePasses()
static constexpr auto describeParameters()
static constexpr auto describeInputPorts()
dwStatus preShutdown() override
constexpr auto describeConstructorArgument(const Args &&... args) -> dw::core::Tuple< Args... >
constexpr std::tuple< dw::core::StringView, dwProcessorType > describePass(dw::core::StringView const &&name, dwProcessorType processorType)
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
dwRigHandle_t rigHandle
Definition: dwRigNode.hpp:56
Definition: Buffer.hpp:40