ROSEndEffector
ROS End-Effector package: provides a ROS-based set of standard interfaces to command robotics end-effectors in an agnostic fashion.
ActionTrig.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 IIT-HHCM
3  * Author: Davide Torielli
4  * email: davide.torielli@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  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef __ROSEE_ACTIONTRIG_H
20 #define __ROSEE_ACTIONTRIG_H
21 
23 #include <yaml-cpp/yaml.h>
24 #include <iostream>
25 
26 namespace ROSEE {
27 
64 class ActionTrig : public ActionPrimitive
65 {
66 
67 public:
68 
69  typedef std::map < std::string, ActionTrig > Map;
70 
71  ActionTrig (std::string actionName, ActionPrimitive::Type);
72  ActionTrig (std::string actionName, ActionPrimitive::Type, std::string tip, JointPos);
73 
79  std::vector < JointPos > getAllJointPos() const override;
80 
85  std::set < std::string> getKeyElements () const override;
86 
87 
91  JointPos getJointPos () const override;
92  void setJointPos (JointPos);
93 
98  std::string getFingerInvolved () const;
99  void setFingerInvolved ( std::string );
100 
101  // we are ok with the default functions of the base class ActionPrimitive
102  //void printAction () const override;
103  //void emitYaml ( YAML::Emitter&) override;
104  bool fillFromYaml( YAML::const_iterator yamlIt ) override;
105 
106 private:
108 };
109 
110 }
111 
112 #endif // __ROSEE_ACTIONTRIG_H
void setJointPos(JointPos)
Definition: ActionTrig.cpp:43
Virtual class, Base of all the primitive actions.
std::map< std::string, ActionTrig > Map
Definition: ActionTrig.h:69
std::map< std::string, std::vector< double > > JointPos
The map to describe the position of all actuated joints.
Definition: Action.h:40
JointPos jointPos
Definition: ActionTrig.h:107
std::set< std::string > getKeyElements() const override
Necessary method to know the key used by the maps which store all the Actions of one type...
Definition: ActionTrig.cpp:39
Type
Enum useful to discriminate each primitive action when, for example, we want to parse a file if you ...
The action of moving some joints (see later) of a single finger in a full clousure position towards t...
Definition: ActionTrig.h:64
bool fillFromYaml(YAML::const_iterator yamlIt) override
function to fill members of the Action with infos taken from yaml files
Definition: ActionTrig.cpp:59
ActionTrig(std::string actionName, ActionPrimitive::Type)
Definition: ActionTrig.cpp:21
std::string getFingerInvolved() const
Specific method of trig to simply return a string instead of the full vector fingersInvolved that in ...
Definition: ActionTrig.cpp:31
void setFingerInvolved(std::string)
Definition: ActionTrig.cpp:54
std::vector< JointPos > getAllJointPos() const override
Overriden get from the pure virtual function of the base class ActionPrimitive The signature must be ...
Definition: ActionTrig.cpp:47
JointPos getJointPos() const override
Overriden get from the pure virtual function of the base class Action.
Definition: ActionTrig.cpp:35