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

@@ -48,9 +48,11 @@
#include <robot_sensor_msgs/LaserScan.h>
#include <robot_laser_geometry/laser_geometry.hpp>
#include <robot_sensor_msgs/DepthCameraData.h>
#include <robot_sensor_msgs/PointCloud.h>
#include <robot_sensor_msgs/PointCloud2.h>
#include <robot_sensor_msgs/point_cloud_conversion.h>
#include <mutex>
@@ -67,7 +69,8 @@ struct CallBackInfo
class ObstacleLayer : public CostmapLayer
{
public:
ObstacleLayer()
ObstacleLayer() :
have_depth_camera_data_(false)
{
costmap_ = NULL; // this is the unsigned char* member of parent class Costmap2D.
}
@@ -178,6 +181,10 @@ protected:
int combination_method_;
std::vector<CallBackInfo> callback_infos_;
std::string depth_camera_topic_;
mutable std::mutex depth_camera_mutex_;
robot_sensor_msgs::DepthCameraData latest_depth_camera_data_;
bool have_depth_camera_data_;
private:
bool getParams(const std::string& config_file_name, robot::NodeHandle &nh);