@@ -27,16 +27,11 @@ namespace RGL
27
27
RGL_CHECK (rgl_node_points_compact_by_field (&m_nodes.m_pointsCompact , RGL_FIELD_IS_HIT_I32));
28
28
ConfigureAngularNoiseNode (0 .0f );
29
29
ConfigureDistanceNoiseNode (0 .0f , 0 .0f );
30
- ConfigureYieldNodes (DefaultFields.data (), DefaultFields.size ());
31
-
32
- ConfigurePcTransformNode (AZ::Matrix3x4::CreateIdentity ());
33
- RGL_CHECK (rgl_node_points_format (&m_nodes.m_pcPublishFormat , DefaultFields.data (), aznumeric_cast<int32_t >(DefaultFields.size ())));
30
+ ConfigureFieldNodes (DefaultFields.data (), DefaultFields.size ());
34
31
35
32
// Non-conditional connections
36
33
RGL_CHECK (rgl_graph_node_add_child (m_nodes.m_rayPoses , m_nodes.m_rayRanges ));
37
34
RGL_CHECK (rgl_graph_node_add_child (m_nodes.m_rayRanges , m_nodes.m_lidarTransform ));
38
- RGL_CHECK (rgl_graph_node_add_child (m_nodes.m_compactYield , m_nodes.m_pointsYield ));
39
- RGL_CHECK (rgl_graph_node_add_child (m_nodes.m_pointCloudTransform , m_nodes.m_pcPublishFormat ));
40
35
41
36
InitializeConditionalConnections ();
42
37
}
@@ -61,14 +56,6 @@ namespace RGL
61
56
// one (or two) rgl_graph_destroy API call(s).
62
57
SetIsNoiseEnabled (true );
63
58
SetIsCompactEnabled (true );
64
- if (IsPublisherConfigured ())
65
- {
66
- SetIsPcPublishingEnabled (true );
67
- }
68
- else
69
- {
70
- rgl_graph_destroy (m_nodes.m_pointCloudTransform );
71
- }
72
59
73
60
rgl_graph_destroy (m_nodes.m_rayPoses );
74
61
}
@@ -77,10 +64,7 @@ namespace RGL
77
64
{
78
65
return IsFeatureEnabled (PipelineFeatureFlags::PointsCompact);
79
66
}
80
- bool PipelineGraph::IsPcPublishingEnabled () const
81
- {
82
- return IsFeatureEnabled (PipelineFeatureFlags::PointCloudPublishing);
83
- }
67
+
84
68
bool PipelineGraph::IsNoiseEnabled () const
85
69
{
86
70
return IsFeatureEnabled (PipelineFeatureFlags::Noise);
@@ -97,11 +81,10 @@ namespace RGL
97
81
RGL_CHECK (rgl_node_rays_set_range (&m_nodes.m_rayRanges , &range, 1 ));
98
82
}
99
83
100
- void PipelineGraph::ConfigureYieldNodes (const rgl_field_t * fields, size_t size)
84
+ void PipelineGraph::ConfigureFieldNodes (const rgl_field_t * fields, size_t size)
101
85
{
102
86
RGL_CHECK (rgl_node_points_yield (&m_nodes.m_pointsYield , fields, aznumeric_cast<int32_t >(size)));
103
87
RGL_CHECK (rgl_node_points_yield (&m_nodes.m_rayTraceYield , fields, aznumeric_cast<int32_t >(size)));
104
- RGL_CHECK (rgl_node_points_yield (&m_nodes.m_compactYield , fields, aznumeric_cast<int32_t >(size)));
105
88
}
106
89
107
90
void PipelineGraph::ConfigureLidarTransformNode (const AZ::Matrix3x4& lidarTransform)
@@ -110,12 +93,6 @@ namespace RGL
110
93
RGL_CHECK (rgl_node_rays_transform (&m_nodes.m_lidarTransform , &RglLidarTransform));
111
94
}
112
95
113
- void PipelineGraph::ConfigurePcTransformNode (const AZ::Matrix3x4& pcTransform)
114
- {
115
- const rgl_mat3x4f rglPcTransform = Utils::RglMat3x4FromAzMatrix3x4 (pcTransform);
116
- RGL_CHECK (rgl_node_points_transform (&m_nodes.m_pointCloudTransform , &rglPcTransform));
117
- }
118
-
119
96
void PipelineGraph::ConfigureAngularNoiseNode (float angularNoiseStdDev)
120
97
{
121
98
RGL_CHECK (rgl_node_gaussian_noise_angular_ray (&m_nodes.m_angularNoise , 0 .0f , angularNoiseStdDev, RGL_AXIS_Z));
@@ -127,27 +104,6 @@ namespace RGL
127
104
rgl_node_gaussian_noise_distance (&m_nodes.m_distanceNoise , 0 .0f , distanceNoiseStdDevBase, distanceNoiseStdDevRisePerMeter));
128
105
}
129
106
130
- void PipelineGraph::ConfigurePcPublisherNode (const AZStd::string& topicName, const AZStd::string& frameId, const ROS2::QoS& qosPolicy)
131
- {
132
- const bool FirstConfiguration = !IsPublisherConfigured ();
133
-
134
- RGL_CHECK (rgl_node_points_ros2_publish_with_qos (
135
- &m_nodes.m_pointCloudPublish ,
136
- topicName.c_str (),
137
- frameId.c_str (),
138
- static_cast <rgl_qos_policy_reliability_t >(static_cast <int >(qosPolicy.GetQoS ().reliability ())),
139
- static_cast <rgl_qos_policy_durability_t >(static_cast <int >(qosPolicy.GetQoS ().durability ())),
140
- static_cast <rgl_qos_policy_history_t >(static_cast <int >(qosPolicy.GetQoS ().history ())),
141
- qosPolicy.GetQoS ().depth ()));
142
-
143
- if (FirstConfiguration)
144
- {
145
- // clang-format off
146
- AddConditionalConnection (m_nodes.m_pcPublishFormat , m_nodes.m_pointCloudPublish , [](const PipelineGraph& graph){ return graph.IsPcPublishingEnabled (); });
147
- // clang-format on
148
- }
149
- }
150
-
151
107
void PipelineGraph::ConfigureRaytraceNodeNonHits (float minRangeNonHitValue, float maxRangeNonHitValue)
152
108
{
153
109
RGL_CHECK (rgl_node_raytrace_configure_non_hits (m_nodes.m_rayTrace , minRangeNonHitValue, maxRangeNonHitValue));
@@ -158,16 +114,6 @@ namespace RGL
158
114
SetIsFeatureEnabled (PipelineFeatureFlags::PointsCompact, value);
159
115
}
160
116
161
- void PipelineGraph::SetIsPcPublishingEnabled (bool value)
162
- {
163
- if (value && !IsPublisherConfigured ())
164
- {
165
- AZ_Assert (false , " Trying to enable publishing without the publisher node configured." );
166
- return ;
167
- }
168
- SetIsFeatureEnabled (PipelineFeatureFlags::PointCloudPublishing, value);
169
- }
170
-
171
117
void PipelineGraph::SetIsNoiseEnabled (bool value)
172
118
{
173
119
SetIsFeatureEnabled (PipelineFeatureFlags::Noise, value);
@@ -197,9 +143,16 @@ namespace RGL
197
143
case RGL_FIELD_ENTITY_ID_I32:
198
144
success = success && GetResult (results.m_packedRglEntityId , RGL_FIELD_ENTITY_ID_I32);
199
145
break ;
146
+ case RGL_FIELD_IS_HIT_I32: // Not needed.
147
+ continue ;
200
148
default :
201
149
success = false ;
202
- AZ_Assert (false , " Invalid result field type!" );
150
+ AZ_Assert (false , AZStd::string::format (" Invalid result field type with RGL id %i!" , field).c_str ());
151
+ break ;
152
+ }
153
+
154
+ if (!success)
155
+ {
203
156
break ;
204
157
}
205
158
}
@@ -238,23 +191,9 @@ namespace RGL
238
191
return graph.IsCompactEnabled ();
239
192
};
240
193
241
- const ConditionType PublishingCondition = [](const PipelineGraph& graph)
242
- {
243
- return graph.IsPcPublishingEnabled ();
244
- };
245
-
246
- // clang-format off
247
194
AddConditionalNode (m_nodes.m_angularNoise , m_nodes.m_lidarTransform , m_nodes.m_rayTrace , NoiseCondition);
248
195
AddConditionalNode (m_nodes.m_distanceNoise , m_nodes.m_rayTrace , m_nodes.m_rayTraceYield , NoiseCondition);
249
- AddConditionalNode (m_nodes.m_pointsCompact , m_nodes.m_rayTraceYield , m_nodes.m_compactYield , CompactCondition);
250
- AddConditionalConnection (m_nodes.m_compactYield , m_nodes.m_pointCloudTransform , PublishingCondition);
251
- // clang-format on
252
- if (IsPublisherConfigured ())
253
- {
254
- // clang-format off
255
- AddConditionalConnection ( m_nodes.m_pcPublishFormat , m_nodes.m_pointCloudPublish , PublishingCondition);
256
- // clang-format on
257
- }
196
+ AddConditionalNode (m_nodes.m_pointsCompact , m_nodes.m_rayTraceYield , m_nodes.m_pointsYield , CompactCondition);
258
197
}
259
198
260
199
void PipelineGraph::UpdateConnections ()
@@ -269,9 +208,13 @@ namespace RGL
269
208
{
270
209
AddConditionalConnection (parent, node, condition);
271
210
AddConditionalConnection (node, child, condition);
272
- // clang-format off
273
- AddConditionalConnection (parent, child, [condition](const PipelineGraph& pipelineGraph){ return !condition (pipelineGraph); });
274
- // clang-format on
211
+ AddConditionalConnection (
212
+ parent,
213
+ child,
214
+ [condition](const PipelineGraph& pipelineGraph)
215
+ {
216
+ return !condition (pipelineGraph);
217
+ });
275
218
}
276
219
277
220
void PipelineGraph::AddConditionalConnection (rgl_node_t parent, rgl_node_t child, const ConditionType& condition)
0 commit comments