Skip to content
Snippets Groups Projects
Commit 4ec5ba29 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Use class bool variable instead of static bool to update motion_group names,...

Use class bool variable instead of static bool to update motion_group names, so it's done for multiple instances of the module
parent 386a2660
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ max_plan_time: 10.0 ...@@ -17,7 +17,7 @@ max_plan_time: 10.0
max_vel_scale: 1.0 max_vel_scale: 1.0
end_effector_tool: "arm_left_grasping_frame" end_effector_tool: "arm_left_grasping_frame"
ws_frame_id: "/base_footprint" ws_frame_id: "base_footprint"
ws_x_min: -1.0 ws_x_min: -1.0
ws_y_min: -1.0 ws_y_min: -1.0
ws_z_min: -1.0 ws_z_min: -1.0
......
...@@ -17,7 +17,7 @@ max_plan_time: 10.0 ...@@ -17,7 +17,7 @@ max_plan_time: 10.0
max_vel_scale: 1.0 max_vel_scale: 1.0
end_effector_tool: "arm_left_tool_link" end_effector_tool: "arm_left_tool_link"
ws_frame_id: "/base_footprint" ws_frame_id: "base_footprint"
ws_x_min: -1.0 ws_x_min: -1.0
ws_y_min: -1.0 ws_y_min: -1.0
ws_z_min: -1.0 ws_z_min: -1.0
......
...@@ -17,7 +17,7 @@ max_plan_time: 10.0 ...@@ -17,7 +17,7 @@ max_plan_time: 10.0
max_vel_scale: 1.0 max_vel_scale: 1.0
end_effector_tool: "arm_tool_link" end_effector_tool: "arm_tool_link"
ws_frame_id: "/base_footprint" ws_frame_id: "base_footprint"
ws_x_min: -1.0 ws_x_min: -1.0
ws_y_min: -1.0 ws_y_min: -1.0
ws_z_min: -1.0 ws_z_min: -1.0
......
...@@ -17,7 +17,7 @@ max_plan_time: 10.0 ...@@ -17,7 +17,7 @@ max_plan_time: 10.0
max_vel_scale: 1.0 max_vel_scale: 1.0
end_effector_tool: "arm_left_tool_link" end_effector_tool: "arm_left_tool_link"
ws_frame_id: "/base_footprint" ws_frame_id: "base_footprint"
ws_x_min: -1.0 ws_x_min: -1.0
ws_y_min: -1.0 ws_y_min: -1.0
ws_z_min: -1.0 ws_z_min: -1.0
......
...@@ -64,6 +64,7 @@ class CTiagoArmModule : public CModule<tiago_arm_module::TiagoArmModuleConfig> ...@@ -64,6 +64,7 @@ class CTiagoArmModule : public CModule<tiago_arm_module::TiagoArmModuleConfig>
tiago_arm_module_status_t status; tiago_arm_module_status_t status;
bool new_motion; bool new_motion;
bool cancel_pending; bool cancel_pending;
bool first_dynamic_reconfigure_call;
// planning objects // planning objects
std::vector<TVisualObject> objects; std::vector<TVisualObject> objects;
......
...@@ -4,6 +4,8 @@ CTiagoArmModule::CTiagoArmModule(const std::string &name,const std::string &name ...@@ -4,6 +4,8 @@ CTiagoArmModule::CTiagoArmModule(const std::string &name,const std::string &name
arm_action("arm",this->module_nh.getNamespace()), arm_action("arm",this->module_nh.getNamespace()),
get_scene("get_planning_scene", this->module_nh.getNamespace()) get_scene("get_planning_scene", this->module_nh.getNamespace())
{ {
this->first_dynamic_reconfigure_call=true;
this->start_operation(); this->start_operation();
// initialize odometry subscriber // initialize odometry subscriber
...@@ -105,29 +107,34 @@ void CTiagoArmModule::state_machine(void) ...@@ -105,29 +107,34 @@ void CTiagoArmModule::state_machine(void)
void CTiagoArmModule::reconfigure_callback(tiago_arm_module::TiagoArmModuleConfig &config, uint32_t level) void CTiagoArmModule::reconfigure_callback(tiago_arm_module::TiagoArmModuleConfig &config, uint32_t level)
{ {
static bool first=true; ROS_INFO("CTiagoArmModule : reconfigure callback: %s", this->module_nh.getNamespace().c_str());
ROS_INFO("CTiagoArmModule : reconfigure callback");
this->lock(); this->lock();
this->config=config; this->config=config;
/* set the module rate */ /* set the module rate */
this->dynamic_reconfigure(config,"arm_module");
this->dynamic_reconfigure(config,"arm");
/* motion action parameters */ /* motion action parameters */
this->arm_action.dynamic_reconfigure(config,"move"); this->arm_action.dynamic_reconfigure(config,"move");
// handle the move groups
if(first) if(this->first_dynamic_reconfigure_call)
{ {
// handle the move groups
this->move_groups.clear(); this->move_groups.clear();
this->move_groups=this->get_strings(this->module_nh,"move_groups"); this->move_groups=this->get_strings(this->module_nh,"move_groups");
this->move_group_joints.resize(this->move_groups.size()); this->move_group_joints.resize(this->move_groups.size());
for(unsigned int i=0;i<this->move_groups.size();i++) for(unsigned int i=0;i<this->move_groups.size();i++)
{
this->move_group_joints[i]=this->get_strings(this->module_nh,this->move_groups[i]); this->move_group_joints[i]=this->get_strings(this->module_nh,this->move_groups[i]);
// HACK: it was impossible to use a parameter call arm with all the joints, so the arm_only name //ROS_INFO("CTiagoArmModule: move_groups[i]=%s",this->move_groups[i].c_str());
for(unsigned int i=0;i<this->move_groups.size();i++)
if(this->move_groups[i]=="arm_only") // HACK: it was impossible to use a parameter called 'arm' with all the joints, so the 'arm_only' name is used
this->move_groups[i]=="arm"; //if(this->move_groups[i]=="arm_only")
first=false; // this->move_groups[i]=="arm";
}
this->first_dynamic_reconfigure_call=false;
} }
this->unlock(); this->unlock();
// planner params // planner params
this->set_planner(config.planner_id); this->set_planner(config.planner_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment