manager_base.cpp
Go to the documentation of this file.
00001 #include <generic_control_toolbox/manager_base.hpp>
00002 
00003 namespace generic_control_toolbox
00004 {
00005 ManagerBase::ManagerBase() {}
00006 ManagerBase::~ManagerBase() {}
00007 
00008 bool getArmInfo(const std::string &arm_name, ArmInfo &info)
00009 {
00010   ros::NodeHandle nh("~");
00011 
00012   return getArmInfo(arm_name, info, nh);
00013 }
00014 
00015 bool getArmInfo(const std::string &arm_name, ArmInfo &info, ros::NodeHandle &nh)
00016 {
00017   bool has_ft_sensor;  // HACK: using the boolean in "ArmInfo" gives an rvalue
00018                        // assignment error that I do not understand
00019 
00020   if (!nh.getParam(arm_name + "/kdl_eef_frame", info.kdl_eef_frame))
00021   {
00022     ROS_ERROR("Missing kinematic chain eef (%s/kdl_eef_frame)",
00023               arm_name.c_str());
00024     return false;
00025   }
00026 
00027   if (!nh.getParam(arm_name + "/gripping_frame", info.gripping_frame))
00028   {
00029     ROS_ERROR("Missing kinematic gripping_frame (%s/gripping_frame)",
00030               arm_name.c_str());
00031     return false;
00032   }
00033 
00034   if (!nh.getParam(arm_name + "/has_ft_sensor", has_ft_sensor))
00035   {
00036     ROS_ERROR("Missing sensor info (%s/has_ft_sensor)", arm_name.c_str());
00037     return false;
00038   }
00039 
00040   info.has_ft_sensor = has_ft_sensor;
00041 
00042   if (!nh.getParam(arm_name + "/sensor_frame", info.sensor_frame))
00043   {
00044     ROS_ERROR("Missing sensor info (%s/sensor_frame)", arm_name.c_str());
00045     return false;
00046   }
00047 
00048   if (!nh.getParam(arm_name + "/sensor_topic", info.sensor_topic))
00049   {
00050     ROS_ERROR("Missing sensor info (%s/sensor_topic)", arm_name.c_str());
00051     return false;
00052   }
00053 
00054   info.name = arm_name;
00055 
00056   return true;
00057 }
00058 }  // namespace generic_control_toolbox


generic_control_toolbox
Author(s): diogo
autogenerated on Thu Jun 6 2019 18:02:57