26 std::string motor_reference_topic =
"/ros_end_effector/motor_reference_pos";
31 std::string joint_state_topic =
"/ros_end_effector/joint_states";
37 if (_hand_info_present) {
71 if (this->fingers_names.size() != 0) {
83 if (this->motors_names.size() != 0) {
96 if (this->motors_stiffness.size() != 0) {
109 if (this->tips_frictions.size() != 0) {
122 if (this->motors_torque_limits.size() != 0) {
135 if (this->tip_joint_to_tip_frame_x.size() != 0) {
147 if (this->tip_joint_to_tip_frame_y.size() != 0) {
159 std::string _rosee_config_path;
160 if (!
_nh->getParam (
"/ros_ee_config_path", _rosee_config_path )) {
164 std::ifstream ifile(_rosee_config_path);
166 ROS_WARN_STREAM (
"EEHALExecutor: config file " << _rosee_config_path <<
" not found");
170 YAML::Node node = YAML::LoadFile(_rosee_config_path);
172 if (! node[
"hand_info"]) {
173 ROS_WARN_STREAM (
"EEHALExecutor: config file " << _rosee_config_path <<
" does not contain " 174 <<
"hand_info node. I will not parse hand information");
179 if(node[
"hand_info"][
"fingers_names"]){
181 fingers_names = node[
"hand_info"][
"fingers_names"].as<std::vector<std::string>>();
184 if(node[
"hand_info"][
"motors_names"]){
186 motors_names = node[
"hand_info"][
"motors_names"].as<std::vector<std::string>>();
189 if(node[
"hand_info"][
"motors_stiffness"]){
194 if(node[
"hand_info"][
"tips_frictions"]){
199 if(node[
"hand_info"][
"motors_torque_limits"]){
204 if(node[
"hand_info"][
"tip_joint_to_tip_frame_x"]){
209 if(node[
"hand_info"][
"tip_joint_to_tip_frame_y"]){
243 rosee_msg::HandInfo::Request& request,
244 rosee_msg::HandInfo::Response& response) {
256 std::string topic_name =
"/ros_end_effector/pressure_phalanges";
258 _pressure_pub =
_nh->advertise<rosee_msg::MotorPhalangePressure>(topic_name, 10);
276 Eigen::VectorXd motorRef;
277 motorRef.resize(
_mr_msg.name.size());
278 for (
int i=0; i<
_mr_msg.name.size(); i++ ) {
280 motorRef(i) =
_mr_msg.position.at(i);
288 Eigen::VectorXd jointPos;
289 jointPos.resize(
_js_msg.name.size());
290 for (
int i=0; i<
_js_msg.name.size(); i++ ) {
292 jointPos(i) =
_js_msg.position.at(i);
300 Eigen::VectorXd jointEffort;
301 jointEffort.resize(
_js_msg.name.size());
302 for (
int i=0; i<
_js_msg.name.size(); i++ ) {
304 jointEffort(i) =
_js_msg.effort.at(i);
312 Eigen::MatrixXd pressure;
314 for (
int i=0; i<
_pressure_msg.pressure_finger1.size(); i++ ) {
Eigen::VectorXd motors_stiffness
ros::Publisher _joint_state_pub
Eigen::VectorXd getJointEffort() const
virtual bool getMotorsNames(std::vector< std::string > &motors_names)
sensor_msgs::JointState _mr_msg
The references that must be read in the move() to send to the real/simulated robot TODO put private a...
Eigen::VectorXd tip_joint_to_tip_frame_y
virtual bool checkCommandPub()
bool initPressureSensing()
Eigen::VectorXd tips_frictions
std::vector< std::string > fingers_names
EEHal(ros::NodeHandle *nh)
static std::vector< float > eigenVectorToStdVector(Eigen::VectorXd eigenVector)
virtual bool publish_joint_state()
virtual bool getFingersNames(std::vector< std::string > &fingers_names)
void motor_reference_clbk(const sensor_msgs::JointState::ConstPtr &msg)
virtual bool getTipsFrictions(Eigen::VectorXd &tips_friction)
virtual bool getTipJointToTipFrameX(Eigen::VectorXd &tip_joint_to_tip_frame_x)
rosee_msg::MotorPhalangePressure _pressure_msg
std::vector< std::string > motors_names
virtual bool getMotorTorqueLimits(Eigen::VectorXd &motors_torque_limits)
ros::Publisher _pressure_pub
ros::Subscriber _motor_reference_sub
virtual bool getTipJointToTipFrameY(Eigen::VectorXd &tip_joint_to_tip_frame_y)
Eigen::VectorXd getMotorReference() const
std::string _hand_info_service_name
Eigen::VectorXd motors_torque_limits
rosee_msg::HandInfo::Response _hand_info_response
virtual bool init_hand_info_response()
init the service message with info parsed from yaml file, ie info that will not change according to h...
bool handInfoEEHalCallback(rosee_msg::HandInfo::Request &request, rosee_msg::HandInfo::Response &response)
sensor_msgs::JointState _js_msg
The states that must be filled in the sense(), reading info from real/simulated robot TODO put privat...
virtual bool isHandInfoPresent()
virtual bool getMotorStiffness(Eigen::VectorXd &motors_stiffness)
Eigen::MatrixXd getPressure() const
static Eigen::VectorXd yamlVectorToEigen(const YAML::Node &vectorNode)
Eigen::VectorXd tip_joint_to_tip_frame_x
virtual bool parseHandInfo()
virtual bool setHandInfoCallback()
Here service is advertise and callback set: if derived class wants to use different callback...
ros::ServiceServer _hand_info_server
Eigen::VectorXd getJointPosition() const