33 #include <std_msgs/Float64.h> 44 "This interface is deprecated, you should probably use the interface provided by the CAN driver directly.");
60 std::string controller_suffix;
61 std::string searched_param;
63 n_tilde.
param(searched_param, controller_suffix, std::string(
"position_controller"));
64 std::string topic_prefix =
"/sa_";
65 std::string topic_suffix =
"_" + controller_suffix +
"/command";
66 std::string full_topic =
"";
71 full_topic = topic_prefix +
"sr" + topic_suffix;
80 full_topic = topic_prefix +
"ss" + topic_suffix;
88 full_topic = topic_prefix +
"es" + topic_suffix;
97 full_topic = topic_prefix +
"er" + topic_suffix;
112 JointsMap::iterator iter =
joints_map.find(joint_name);
113 std_msgs::Float64 target_msg;
118 ROS_DEBUG(
"Joint %s not found", joint_name.c_str());
127 if (target < tmpData.
min)
129 target = tmpData.
min;
131 if (target > tmpData.
max)
133 target = tmpData.
max;
158 JointsMap::iterator iter =
joints_map.find(joint_name);
169 ROS_ERROR(
"Joint %s not found.", joint_name.c_str());
182 "The set Controller function is not implemented in the CAN compatibility wrapper," 183 " please use the provided services directly.");
191 "The get Controller function is not implemented in the CAN compatibility wrapper," 192 " please use the provided services directly.");
198 ROS_WARN(
"The set config function is not implemented.");
204 ROS_WARN(
"The get config function is not implemented.");
209 std::vector <DiagnosticData> returnVect;
220 for (
size_t index = 0; index < msg->name.size(); ++index)
222 std::string joint_name = msg->name[index];
223 JointsMap::iterator iter =
joints_map.find(joint_name);
235 tmpData.
force = msg->effort[index];
236 tmpData.
velocity = msg->velocity[index];
virtual JointControllerData getContrl(std::string ctrlr_name)
ROS_DEPRECATED CANCompatibilityArm()
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
virtual JointsMap getAllJointsData()
std::map< std::string, JointData > JointsMap
virtual int16_t sendupdate(std::string joint_name, double target)
void joint_states_callback(const sensor_msgs::JointStateConstPtr &msg)
virtual std::vector< DiagnosticData > getDiagnostics()
static double to_degrees(double rad)
static double to_rad(double degrees)
virtual JointData getJointData(std::string joint_name)
virtual ~CANCompatibilityArm()
bool searchParam(const std::string &key, std::string &result) const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
JointsMap joints_map
A mapping between the joint names and the information regarding those joints.
virtual int16_t setContrl(std::string contrlr_name, JointControllerData ctrlr_data)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
This is a parent class for the different types of Shadowhand we can have. It makes it possible to swa...
boost::mutex joints_map_mutex
ros::Subscriber joint_state_subscriber
virtual void getConfig(std::string joint_name)
std::vector< ros::Publisher > CAN_publishers
virtual int16_t setConfig(std::vector< std::string > myConfig)
This compatibility interface is a wrapper around the new CAN Hand ROS driver. It is used to present t...