update obstacle_layer

This commit is contained in:
2026-01-06 17:33:13 +07:00
parent ae469e3271
commit 800e5c1735
6 changed files with 637 additions and 128 deletions

View File

@@ -55,7 +55,9 @@
#include <robot/node_handle.h>
#include <robot/plugin_loader_helper.h>
class SuperValue : public robot::XmlRpc::XmlRpcValue
#include <csignal>
class RobotSuperValue : public robot::XmlRpc::XmlRpcValue
{
public:
void setStruct(robot::XmlRpc::XmlRpcValue::ValueStruct* a)
@@ -73,6 +75,12 @@ public:
namespace robot_costmap_2d
{
void signalHandler(int)
{
std::signal(SIGINT, SIG_DFL);
std::raise(SIGINT);
}
/** @brief A ROS wrapper for a 2D Costmap. Handles subscribing to
* topics that provide observations about obstacles in either the form
* of PointCloud or LaserScan messages. */

View File

@@ -51,8 +51,16 @@
#include <robot_sensor_msgs/PointCloud2.h>
#include <robot_sensor_msgs/point_cloud_conversion.h>
#include <robot/console.h>
namespace robot_costmap_2d
{
struct CallBackInfo
{
std::string data_type;
std::string topic;
bool inf_is_valid;
};
class ObstacleLayer : public CostmapLayer
{
@@ -167,6 +175,7 @@ protected:
bool stop_receiving_data_ = false;
int combination_method_;
std::vector<CallBackInfo> callback_infos_;
private:
bool getParams(const std::string& config_file_name, robot::NodeHandle &nh);