feat(depth): observed_volume depth clearing as deployed 2026-10-14
Baseline commit of the working-tree refactor built on 2026-10-14 17:24 and running on the KIT robot, recorded in one commit before further changes. - VoxelLayer clearing looks up TF at the depth image stamp. - ObservationBuffer: per-source cloud preparation at the measurement stamp, height/range gate before the PCL VoxelGrid. - DepthFramePairer: pairs the marking cloud with the clearing image by source and stamp, bounded queue and age. - DepthVisibilityChecker and the observed_volume clearing mode in VoxelLayer; the legacy frustum mode stays the default. - Tests: depth_observation_buffer_test, depth_visibility_test.
This commit is contained in:
@@ -50,6 +50,14 @@
|
||||
|
||||
namespace robot_costmap_2d
|
||||
{
|
||||
// Opt-in per source: legacy callers keep their TF and cloud policy.
|
||||
struct CloudProcessingConfig
|
||||
{
|
||||
bool transform_at_stamp{false};
|
||||
bool voxel_filter_enabled{false};
|
||||
double voxel_leaf_size{0.05}; // [m], applied after height/range gates
|
||||
};
|
||||
|
||||
/**
|
||||
* @class ObservationBuffer
|
||||
* @brief Takes in point clouds from sensors, transforms them to the desired frame, and stores them
|
||||
@@ -104,6 +112,14 @@ public:
|
||||
*/
|
||||
void bufferCloud(const robot_sensor_msgs::PointCloud2& cloud);
|
||||
|
||||
// Configure before receiving samples. Empty valid clouds return true;
|
||||
// missing TF/malformed observations return false and do not refresh the buffer.
|
||||
void setCloudProcessingConfig(const CloudProcessingConfig& config);
|
||||
bool tryBufferCloud(const robot_sensor_msgs::PointCloud2& cloud);
|
||||
bool tryBufferCloudWithTransform(const robot_sensor_msgs::PointCloud2& cloud,
|
||||
const tf3::TransformStampedMsg& transform);
|
||||
const std::string& sensorFrame() const { return sensor_frame_; }
|
||||
|
||||
/**
|
||||
* @brief Store the newest depth frame without converting it to PointCloud2.
|
||||
*/
|
||||
@@ -156,6 +172,8 @@ private:
|
||||
void purgeStaleObservations();
|
||||
|
||||
void purgeStaleDepthObservations();
|
||||
bool tryBufferCloudImpl(const robot_sensor_msgs::PointCloud2& cloud,
|
||||
const tf3::TransformStampedMsg* prepared_transform);
|
||||
|
||||
tf3::BufferCore& tf3_buffer_;
|
||||
const robot::Duration observation_keep_time_;
|
||||
@@ -172,6 +190,7 @@ private:
|
||||
double obstacle_range_, raytrace_range_;
|
||||
double tf_tolerance_;
|
||||
DepthFrustumConfig frustum_config_;
|
||||
CloudProcessingConfig cloud_processing_config_;
|
||||
};
|
||||
} // namespace robot_costmap_2d
|
||||
#endif // ROBOT_COSTMAP_2D_OBSERVATION_BUFFER_H_
|
||||
|
||||
Reference in New Issue
Block a user