change topic and msg depth camera

This commit is contained in:
2026-07-11 09:50:40 +07:00
parent a2a021c114
commit faa57d9c93
5 changed files with 311 additions and 7 deletions

View File

@@ -232,6 +232,22 @@ void ObstacleLayer::handleImpl(const void* data,
{
if(!stop_receiving_data_)
{
if (type == typeid(robot_sensor_msgs::DepthCameraData) &&
(depth_camera_topic_.empty() || topic == depth_camera_topic_))
{
const robot_sensor_msgs::DepthCameraData& depth_camera_data =
*static_cast<const robot_sensor_msgs::DepthCameraData*>(data);
if (depth_camera_data.camera_info.K[0] <= 0.0 || depth_camera_data.camera_info.K[4] <= 0.0)
{
robot::log_error("ObstacleLayer received invalid camera intrinsics for depth clearing\n");
return;
}
std::lock_guard<std::mutex> lock(depth_camera_mutex_);
latest_depth_camera_data_ = depth_camera_data;
have_depth_camera_data_ = true;
return;
}
if(observation_buffers_.empty() || callback_infos_.empty()) return;