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 (has_ft_sensor)
43  {
44  if (!nh.getParam(arm_name + "/sensor_frame", info.sensor_frame))
45  {
46  ROS_ERROR("Missing sensor info (%s/sensor_frame)", arm_name.c_str());
47  return false;
48  }
49 
50  if (!nh.getParam(arm_name + "/sensor_topic", info.sensor_topic))
51  {
52  ROS_ERROR("Missing sensor info (%s/sensor_topic)", arm_name.c_str());
53  return false;
54  }
55  }
56 
57  info.name = arm_name;
58 
59  return true;
60 }
61 } // 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 Wed Apr 28 2021 03:01:15