Skip to content

Commit 6160903

Browse files
fix input conversion for unknown label value (#18)
* fix input conversion for unknown label value * fix formatting
1 parent 345830d commit 6160903

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

semantic_inference_ros/src/pointcloud_projection.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,22 @@ void recolorCloud(PointCloud2& output,
239239

240240
} // namespace
241241

242+
struct LabelConverter {
243+
static int32_t toIntermediate(uint32_t orig, std::string&) { return orig; }
244+
245+
static void fromIntermediate(const int32_t& intermediate,
246+
uint32_t& value,
247+
std::string&) {
248+
value = intermediate;
249+
}
250+
};
251+
242252
void declare_config(ProjectionConfig& config) {
243253
using namespace config;
244254
name("ProjectionConfig::Config");
245255
field(config.use_lidar_frame, "use_lidar_frame");
246256
field(config.discard_out_of_view, "discard_out_of_view");
247-
field(config.unknown_label, "unknown_label");
257+
field<LabelConverter>(config.unknown_label, "unknown_label");
248258
field(config.input_label_fieldname, "input_label_fieldname");
249259
field(config.override_labels, "override_labels");
250260
field(config.allowed_labels, "allowed_labels");

0 commit comments

Comments
 (0)