manager_base.cpp
Go to the documentation of this file.
2 
4 {
7 
8 bool getArmInfo(const std::string &arm_name, ArmInfo &info)
9 {
10  ros::NodeHandle nh("~");
11 
12  return getArmInfo(arm_name, info, nh);
13 }
14 
15 bool getArmInfo(const std::string &arm_name, ArmInfo &info, ros::NodeHandle &nh)
16 {
17  bool has_ft_sensor; // HACK: using the boolean in "ArmInfo" gives an rvalue
18  // assignment error that I do not understand
19 
20  if (!nh.getParam(arm_name + "/kdl_eef_frame", info.kdl_eef_frame))
21  {
22  ROS_ERROR("Missing kinematic chain eef (%s/kdl_eef_frame)",
23  arm_name.c_str());
24  return false;
25  }
26 
27  if (!nh.getParam(arm_name + "/gripping_frame", info.gripping_frame))
28  {
29  ROS_ERROR("Missing kinematic gripping_frame (%s/gripping_frame)",
30  arm_name.c_str());
31  return false;
32  }
33 
34  if (!nh.getParam(arm_name + "/has_ft_sensor", has_ft_sensor))
35  {
36  ROS_ERROR("Missing sensor info (%s/has_ft_sensor)", arm_name.c_str());
37  return false;
38  }
39 
40  info.has_ft_sensor = has_ft_sensor;
41 
42  if (!nh.getParam(arm_name + "/sensor_frame", info.sensor_frame))
43  {
44  ROS_ERROR("Missing sensor info (%s/sensor_frame)", arm_name.c_str());
45  return false;
46  }
47 
48  if (!nh.getParam(arm_name + "/sensor_topic", info.sensor_topic))
49  {
50  ROS_ERROR("Missing sensor info (%s/sensor_topic)", arm_name.c_str());
51  return false;
52  }
53 
54  info.name = arm_name;
55 
56  return true;
57 }
58 } // namespace generic_control_toolbox
bool getArmInfo(const std::string &arm_name, ArmInfo &info, ros::NodeHandle &nh)
bool getParam(const std::string &key, std::string &s) const
#define ROS_ERROR(...)


generic_control_toolbox
Author(s): diogo
autogenerated on Thu Jun 6 2019 19:54:44