SMACC
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cl_move_base_z::CostmapProxy Class Reference

#include <cp_costmap_switch.h>

Collaboration diagram for cl_move_base_z::CostmapProxy:
Collaboration graph

Public Member Functions

 CostmapProxy (std::string costmap_name, std::string enablePropertyName)
 
void setCostmapEnabled (bool value)
 

Private Member Functions

void dynreconfCallback (const dynamic_reconfigure::Config::ConstPtr &configuration_update)
 

Private Attributes

std::string costmapName_
 
dynamic_reconfigure::Config enableReq
 
dynamic_reconfigure::Config disableReq
 
ros::Subscriber dynrecofSub_
 

Detailed Description

Definition at line 60 of file cp_costmap_switch.h.

Constructor & Destructor Documentation

◆ CostmapProxy()

cl_move_base_z::CostmapProxy::CostmapProxy ( std::string  costmap_name,
std::string  enablePropertyName 
)

Definition at line 99 of file cp_costmap_switch.cpp.

100{
101 this->costmapName_ = costmap_name + "/set_parameters";
102 dynamic_reconfigure::BoolParameter enableField;
103 enableField.name = "enabled";
104 enableField.value = true;
105
106 enableReq.bools.push_back(enableField);
107
108 enableField.value = false;
109 disableReq.bools.push_back(enableField);
110}
dynamic_reconfigure::Config disableReq
dynamic_reconfigure::Config enableReq

References costmapName_, disableReq, and enableReq.

Member Function Documentation

◆ dynreconfCallback()

void cl_move_base_z::CostmapProxy::dynreconfCallback ( const dynamic_reconfigure::Config::ConstPtr &  configuration_update)
private

Definition at line 133 of file cp_costmap_switch.cpp.

134{
135 // auto gp = std::find_if(configuration_update->strs.begin(), configuration_update->strs.begin(),
136 // [&](const dynamic_reconfigure::StrParameter &p) { return p.name == "base_global_planner" && p.value == desired_global_planner_; });
137}

◆ setCostmapEnabled()

void cl_move_base_z::CostmapProxy::setCostmapEnabled ( bool  value)

Definition at line 112 of file cp_costmap_switch.cpp.

113{
114 dynamic_reconfigure::ReconfigureRequest srv_req;
115 dynamic_reconfigure::ReconfigureResponse srv_resp;
116
117 if (value)
118 srv_req.config = enableReq;
119 else
120 srv_req.config = disableReq;
121
122 if (ros::service::exists(costmapName_, true))
123 {
124 ROS_INFO("sending dynamic reconfigure request: %s", costmapName_.c_str());
125 ros::service::call(costmapName_, srv_req, srv_resp);
126 }
127 else
128 {
129 ROS_WARN("could not call dynamic reconfigure server. It does not exist: %s", costmapName_.c_str());
130 }
131}

References costmapName_, disableReq, and enableReq.

Member Data Documentation

◆ costmapName_

std::string cl_move_base_z::CostmapProxy::costmapName_
private

Definition at line 68 of file cp_costmap_switch.h.

Referenced by CostmapProxy(), and setCostmapEnabled().

◆ disableReq

dynamic_reconfigure::Config cl_move_base_z::CostmapProxy::disableReq
private

Definition at line 70 of file cp_costmap_switch.h.

Referenced by CostmapProxy(), and setCostmapEnabled().

◆ dynrecofSub_

ros::Subscriber cl_move_base_z::CostmapProxy::dynrecofSub_
private

Definition at line 74 of file cp_costmap_switch.h.

◆ enableReq

dynamic_reconfigure::Config cl_move_base_z::CostmapProxy::enableReq
private

Definition at line 69 of file cp_costmap_switch.h.

Referenced by CostmapProxy(), and setCostmapEnabled().


The documentation for this class was generated from the following files: