10 "WrenchManager: Missing max_tf_attempts parameter, setting default");
19 sub_pair.second.shutdown();
24 const std::string &gripping_point_frame)
28 ROS_ERROR(
"Cannot set gripping point for end-effector %s: not initialized",
29 end_effector.c_str());
34 geometry_msgs::PoseStamped sensor_to_gripping_point;
35 sensor_to_gripping_point.header.frame_id = sensor_frame;
36 sensor_to_gripping_point.header.stamp =
ros::Time(0);
37 sensor_to_gripping_point.pose.position.x = 0;
38 sensor_to_gripping_point.pose.position.y = 0;
39 sensor_to_gripping_point.pose.position.z = 0;
40 sensor_to_gripping_point.pose.orientation.x = 0;
41 sensor_to_gripping_point.pose.orientation.y = 0;
42 sensor_to_gripping_point.pose.orientation.z = 0;
43 sensor_to_gripping_point.pose.orientation.w = 1;
51 sensor_to_gripping_point);
56 ROS_WARN(
"TF exception in wrench manager: %s", ex.what());
61 if (attempts >= max_tf_attempts_)
64 "WrenchManager: could not find the transform between the sensor frame " 65 "%s and gripping point %s",
66 sensor_frame.c_str(), gripping_point_frame.c_str());
71 tf::poseMsgToKDL(sensor_to_gripping_point.pose, sensor_to_gripping_point_kdl);
78 const std::string &end_effector,
const std::string &sensor_frame,
79 const std::string &gripping_point_frame,
const std::string &sensor_topic,
80 const std::string &calib_matrix_param)
85 "Cannot initialize wrench subscriber for end-effector %s: already " 87 end_effector.c_str());
103 "WrenchManager: missing force torque sensor calibration matrix " 104 "parameter %s. Setting default.",
105 calib_matrix_param.c_str());
106 C = Eigen::Matrix<double, 6, 6>::Identity();
110 if (C.cols() != 6 || C.rows() != 6)
112 ROS_ERROR(
"WrenchManager: calibration matrix must be 6x6. Got %ldx%ld",
125 sensor_topic +
"_converted", 1);
131 const std::string &end_effector, Eigen::Matrix<double, 6, 1> &wrench)
const 139 geometry_msgs::WrenchStamped temp_wrench;
154 const std::string &end_effector, Eigen::Matrix<double, 6, 1> &wrench)
const 162 geometry_msgs::WrenchStamped temp_wrench;
177 const std::string &end_effector, Eigen::Matrix<double, 6, 1> &wrench)
const 190 const geometry_msgs::WrenchStamped::ConstPtr &msg)
195 if (msg->header.frame_id == it.second)
205 "WrenchManager: got wrench message from sensor at frame %s, which " 207 "not configured in the wrench manager",
208 msg->header.frame_id.c_str());
213 Eigen::Matrix<double, 6, 1> wrench_eig;
221 if (arm_info.has_ft_sensor)
224 arm_info.kdl_eef_frame, arm_info.sensor_frame,
225 arm_info.gripping_frame, arm_info.sensor_topic,
226 arm_info.name +
"/sensor_calib"))
231 ROS_DEBUG(
"WrenchManager: successfully initialized wrench comms for arm %s",
232 arm_info.name.c_str());
236 ROS_WARN(
"WrenchManager: end-effector %s has no F/T sensor.",
237 arm_info.kdl_eef_frame.c_str());
244 std::shared_ptr<WrenchManager> &manager)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void wrenchKDLToEigen(const KDL::Wrench &k, Eigen::Matrix< double, 6, 1 > &e)
bool getParam(const std::string &key, std::string &s) const
void wrenchMsgToEigen(const geometry_msgs::Wrench &m, Eigen::Matrix< double, 6, 1 > &e)
void poseMsgToKDL(const geometry_msgs::Pose &m, KDL::Frame &k)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void wrenchKDLToMsg(const KDL::Wrench &k, geometry_msgs::Wrench &m)
void wrenchEigenToKDL(const Eigen::Matrix< double, 6, 1 > &e, KDL::Wrench &k)