10 "WrenchManager: Missing max_tf_attempts parameter, setting default");
18 const std::string &end_effector,
const std::string &sensor_frame,
19 const std::string &gripping_point_frame,
const std::string &sensor_topic,
20 const std::string &calib_matrix_param)
25 "Cannot initialize wrench subscriber for end-effector %s: already " 27 end_effector.c_str());
32 geometry_msgs::PoseStamped sensor_to_gripping_point;
33 sensor_to_gripping_point.header.frame_id = sensor_frame;
34 sensor_to_gripping_point.header.stamp =
ros::Time(0);
35 sensor_to_gripping_point.pose.position.x = 0;
36 sensor_to_gripping_point.pose.position.y = 0;
37 sensor_to_gripping_point.pose.position.z = 0;
38 sensor_to_gripping_point.pose.orientation.x = 0;
39 sensor_to_gripping_point.pose.orientation.y = 0;
40 sensor_to_gripping_point.pose.orientation.z = 0;
41 sensor_to_gripping_point.pose.orientation.w = 1;
49 sensor_to_gripping_point);
54 ROS_WARN(
"TF exception in wrench manager: %s", ex.what());
59 if (attempts >= max_tf_attempts_)
62 "WrenchManager: could not find the transform between the sensor frame " 63 "%s and gripping point %s",
64 sensor_frame.c_str(), gripping_point_frame.c_str());
72 "WrenchManager: missing force torque sensor calibration matrix " 74 calib_matrix_param.c_str());
78 if (C.cols() != 6 || C.rows() != 6)
80 ROS_ERROR(
"WrenchManager: calibration matrix must be 6x6. Got %ldx%ld",
88 tf::poseMsgToKDL(sensor_to_gripping_point.pose, sensor_to_gripping_point_kdl);
96 sensor_topic +
"_converted", 1);
102 const std::string &end_effector, Eigen::Matrix<double, 6, 1> &wrench)
const 110 geometry_msgs::WrenchStamped temp_wrench;
125 const std::string &end_effector, Eigen::Matrix<double, 6, 1> &wrench)
const 138 const geometry_msgs::WrenchStamped::ConstPtr &msg)
143 if (msg->header.frame_id == it.second)
153 "WrenchManager: got wrench message from sensor at frame %s, which was " 154 "not configured in the wrench manager",
155 msg->header.frame_id.c_str());
160 Eigen::Matrix<double, 6, 1> wrench_eig;
168 if (arm_info.has_ft_sensor)
171 arm_info.kdl_eef_frame, arm_info.sensor_frame,
172 arm_info.gripping_frame, arm_info.sensor_topic,
173 arm_info.name +
"/sensor_calib"))
178 ROS_DEBUG(
"WrenchManager: successfully initialized wrench comms for arm %s",
179 arm_info.name.c_str());
183 ROS_WARN(
"WrenchManager: end-effector %s has no F/T sensor.",
184 arm_info.kdl_eef_frame.c_str());
191 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)
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)
bool getParam(const std::string &key, std::string &s) const
void wrenchKDLToMsg(const KDL::Wrench &k, geometry_msgs::Wrench &m)
void wrenchEigenToKDL(const Eigen::Matrix< double, 6, 1 > &e, KDL::Wrench &k)