ROSEndEffector
ROS End-Effector package: provides a ROS-based set of standard interfaces to command robotics end-effectors in an agnostic fashion.
EEInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 IIT-HHCM
3  * Author: Luca Muratore
4  * email: luca.muratore@iit.it
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 */
17 
18 #ifndef __ROSEE_EE_INTERFACE__
19 #define __ROSEE_EE_INTERFACE__
20 
21 #include <map>
22 #include <vector>
23 #include <memory>
24 
25 #include <end_effector/Parser.h>
26 
27 #include <Eigen/Dense>
28 
29 
30 namespace ROSEE {
31 
36  class EEInterface {
37 
38  public:
39 
40  typedef std::shared_ptr<EEInterface> Ptr;
41  typedef std::shared_ptr<const EEInterface> ConstPtr;
42 
43  EEInterface( const ROSEE::Parser& p );
44  //EEInterface ( const EEInterface& other );
45  //EEInterface& operator= ( const EEInterface& p );
46  virtual ~EEInterface();
47 
53  const std::vector<std::string>& getFingers();
54 
61  bool isFinger( std::string finger_name );
62 
68  const std::vector<std::string>& getActuatedJoints();
69 
77  bool getActuatedJointsInFinger( std::string finger_name, std::vector<std::string>& actuated_joints );
78 
85 
92  int getActuatedJointsNumInFinger( std::string finger_name );
93 
99  Eigen::VectorXd getUpperPositionLimits();
100 
106  Eigen::VectorXd getLowerPositionLimits();
107 
115  bool getInternalIdsForFinger( std::string finger_name, std::vector< int >& internal_ids );
116 
124  bool getInternalIdForJoint ( std::string joint_name, int& internal_id );
125 
131  int getFingersNumber();
132 
138  std::string getName();
139 
140  private:
141 
142  std::map<std::string, std::vector<std::string>> _ee_description;
143  std::map<std::string, urdf::JointConstSharedPtr> _urdf_joint_map;
144 
145  std::map<std::string, std::vector<int>> _finger_joints_internal_id_map;
146 
147  std::map<std::string, int> _joints_internal_id_map;
148 
149  std::vector<std::string> _fingers_names, _actuated_joints;
150 
151  Eigen::VectorXd _upper_limits, _lower_limits;
152 
153  std::string _ee_name;
154 
155  int _joints_num = 0;
156 
157 
158 
159  };
160 
161 }
162 
163 #endif // __ROSEE_EE_INTERFACE__
std::shared_ptr< EEInterface > Ptr
Definition: EEInterface.h:40
bool getInternalIdsForFinger(std::string finger_name, std::vector< int > &internal_ids)
getter for the internal ids (position in the EEInterface vectors) of joints in a certain finger ...
Definition: EEInterface.cpp:98
std::vector< std::string > _fingers_names
Definition: EEInterface.h:149
bool getActuatedJointsInFinger(std::string finger_name, std::vector< std::string > &actuated_joints)
getter for the actuated joints of a finger
std::vector< std::string > _actuated_joints
Definition: EEInterface.h:149
std::map< std::string, int > _joints_internal_id_map
Definition: EEInterface.h:147
std::string _ee_name
Definition: EEInterface.h:153
std::map< std::string, std::vector< std::string > > _ee_description
Definition: EEInterface.h:142
int getFingersNumber()
getter for the number of fingers in the End-Effector
const std::vector< std::string > & getActuatedJoints()
getter for the actuated joints of the end-effector
std::string getName()
getter for the EE name
Definition: EEInterface.cpp:69
bool getInternalIdForJoint(std::string joint_name, int &internal_id)
getter for the internal id of a certain joint
Definition: EEInterface.cpp:85
std::shared_ptr< const EEInterface > ConstPtr
Definition: EEInterface.h:41
virtual ~EEInterface()
int getActuatedJointsNum()
getter for the number of actuated joints in the end-effector
Eigen::VectorXd getUpperPositionLimits()
getter for the upper position limits of EE joints as specified in the URDF
Definition: EEInterface.cpp:80
bool isFinger(std::string finger_name)
check is the requested finger exists
const std::vector< std::string > & getFingers()
getter for the fingers name in the current End-Effector
Eigen::VectorXd getLowerPositionLimits()
getter for the lower position limits of EE joints as specified in the URDF
Definition: EEInterface.cpp:75
std::map< std::string, urdf::JointConstSharedPtr > _urdf_joint_map
Definition: EEInterface.h:143
int getActuatedJointsNumInFinger(std::string finger_name)
getter for the number of actuated joints in the requested finger
Class responsible for parsing the YAML file providing the URDF, SRDF, the EE-HAL library implementati...
Definition: Parser.h:46
Eigen::VectorXd _lower_limits
Definition: EEInterface.h:151
Eigen::VectorXd _upper_limits
Definition: EEInterface.h:151
EEInterface(const ROSEE::Parser &p)
Definition: EEInterface.cpp:20
Class representing and End-Effector.
Definition: EEInterface.h:36
std::map< std::string, std::vector< int > > _finger_joints_internal_id_map
Definition: EEInterface.h:145