Skip to content

Commit d80d6d2

Browse files
vreijgwart-bdaiexploy-bot
authored andcommitted
Remove support for custom unobserved values
### What change is being made Removes the deprecated `unobserved_value` field from spherical range image metadata. ### Why this change is being made All image APIs now use `NaN` to represent unobserved pixels. For details, see the [Camera and LiDAR Conventions](https://app.notion.com/p/theaiinstitute/Camera-and-LiDAR-conventions-32ced28d384980f6a9e8f32030ba275d) in Notion. The metadata field is therefore no longer needed. Removing it avoids ambiguity and also avoids having to represent and parse `NaN` floating-point values in JSON, which is not natively supported by the [nlohmann/json](https://github.com/nlohmann/json) library. ### Tested Tested in MuJoCo with: * A modern navigation policy using `NaN` for unobserved pixels * Legacy policies using `-1` for unobserved pixels Legacy policy compatibility is temporarily provided by control [PR #4332](https://github.com/rai-inst/control/pull/4332) to support the transition. GitOrigin-RevId: e4ab29ddfb800de6c929b9767bc328c73d15ba17
1 parent f5241e0 commit d80d6d2

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

control/include/exploy/metadata.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,14 @@ inline void from_json(const json& j, HeightScanMetadata& hs) {
158158
/**
159159
* @brief Metadata for spherical image sensors (e.g., LiDAR).
160160
*
161-
* Specifies the configuration for spherical images including resolution, field of view,
162-
* and sentinel value for unobserved points.
161+
* Specifies the configuration for spherical images including resolution and field of view.
163162
*/
164163
struct SphericalImageMetadata {
165164
std::string pattern_type{}; ///< Spherical image pattern type.
166165
int v_res{}; ///< Vertical resolution (number of vertical scan lines).
167166
int h_res{}; ///< Horizontal resolution (points per scan line).
168167
double v_fov_min_deg{}; ///< Minimum vertical field of view in degrees.
169168
double v_fov_max_deg{}; ///< Maximum vertical field of view in degrees.
170-
double unobserved_value{}; ///< Sentinel value for unobserved/invalid points.
171169
};
172170

173171
/**
@@ -182,7 +180,6 @@ inline void from_json(const json& j, SphericalImageMetadata& si) {
182180
j.at("h_res").get_to(si.h_res);
183181
j.at("v_fov_min_deg").get_to(si.v_fov_min_deg);
184182
j.at("v_fov_max_deg").get_to(si.v_fov_max_deg);
185-
j.at("unobserved_value").get_to(si.unobserved_value);
186183
}
187184

188185
/**

control/include/exploy/state_interface.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,11 @@ struct HeightScanInfo {
172172
/// @brief Arguments for RobotStateInterface::initSphericalImage and
173173
/// RobotStateInterface::sphericalImage.
174174
struct SphericalImageInfo {
175-
std::string sensor_name; ///< Name of the spherical image sensor.
176-
int v_res{}; ///< Number of pixels in vertical direction (used by init).
177-
int h_res{}; ///< Number of pixels in horizontal direction (used by init).
178-
double v_fov_min_deg{}; ///< Minimum vertical field of view angle in degrees (used by init).
179-
double v_fov_max_deg{}; ///< Maximum vertical field of view angle in degrees (used by init).
180-
double unobserved_value{}; ///< Sentinel value for pixels with no sensor return (used by init).
175+
std::string sensor_name; ///< Name of the spherical image sensor.
176+
int v_res{}; ///< Number of pixels in vertical direction (used by init).
177+
int h_res{}; ///< Number of pixels in horizontal direction (used by init).
178+
double v_fov_min_deg{}; ///< Minimum vertical field of view angle in degrees (used by init).
179+
double v_fov_max_deg{}; ///< Maximum vertical field of view angle in degrees (used by init).
181180
std::unordered_set<std::string> channel_names{}; ///< Channel names to include / retrieve.
182181
};
183182

control/src/components.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ SphericalImageInput::SphericalImageInput(const std::string& key, const std::stri
424424
.h_res = static_cast<int>(metadata.h_res),
425425
.v_fov_min_deg = metadata.v_fov_min_deg,
426426
.v_fov_max_deg = metadata.v_fov_max_deg,
427-
.unobserved_value = metadata.unobserved_value,
428427
.channel_names = channel_names,
429428
} {}
430429

control/test/testdata/test_onnx_generator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ def get_sensor_metadata() -> dict:
182182
"h_res": 1024,
183183
"v_fov_min_deg": -45.0,
184184
"v_fov_max_deg": 45.0,
185-
"unobserved_value": -2.0,
186185
},
187186
"sensor.pinhole_image.one": {
188187
"pattern_type": "grid_pattern",

0 commit comments

Comments
 (0)