ActionComposed.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_ACTIONCOMPOSED_H
20 #define __ROSEE_ACTIONCOMPOSED_H
21 
22 #include <vector>
23 #include <string>
25 #include <end_effector/Utils.h>
26 #include <yaml-cpp/yaml.h>
27 #include <memory>
28 
29 
30 namespace ROSEE{
31 
45 {
46 
47 public:
48  typedef std::shared_ptr<ActionComposed> Ptr;
49  typedef std::shared_ptr<const ActionComposed> ConstPtr;
50 
52  ActionComposed(std::string name);
53  ActionComposed(std::string name, bool independent);
56  ActionComposed (const ActionComposed &other);
57 
58 
63  unsigned int numberOfInnerActions () const;
64 
69  bool isIndependent () const;
70 
75  std::vector <std::string> getInnerActionsNames() const ;
76 
80  virtual void print () const override;
81 
86  virtual void emitYaml ( YAML::Emitter& out) const override;
87 
93  virtual bool fillFromYaml( YAML::const_iterator yamlIt ) override;
94 
103  virtual bool sumAction ( ROSEE::Action::Ptr action , double jointPosScaleFactor = 1.0, unsigned int jointPosIndex = 0 );
104 
110  bool empty();
111 
112 protected:
113  std::vector < std::string > innerActionsNames;
114  unsigned int nInnerActions;
115 
116  bool independent; //true if each primitive must set different joint states
117 
118  bool checkIndependency ( ROSEE::Action::Ptr action );
119 
120 
121 };
122 }
123 
124 #endif // __ROSEE_ACTIONCOMPOSED_H
ROSEE::ActionComposed::numberOfInnerActions
unsigned int numberOfInnerActions() const
Definition: ActionComposed.cpp:39
ROSEE::ActionComposed::ActionComposed
ActionComposed()
Definition: ActionComposed.cpp:21
ROSEE::ActionComposed::nInnerActions
unsigned int nInnerActions
Definition: ActionComposed.h:114
ROSEE::ActionGeneric
Class to handle a generic, simple action. Differently from other class, this is easily creable manual...
Definition: ActionGeneric.h:32
ROSEE::ActionComposed::innerActionsNames
std::vector< std::string > innerActionsNames
Definition: ActionComposed.h:113
ActionGeneric.h
ROSEE::ActionComposed::empty
bool empty()
Check if the action composed is empty.
Definition: ActionComposed.cpp:51
ROSEE
Definition: EEInterface.h:30
ROSEE::ActionComposed::checkIndependency
bool checkIndependency(ROSEE::Action::Ptr action)
Definition: ActionComposed.cpp:147
ROSEE::ActionComposed::Ptr
std::shared_ptr< ActionComposed > Ptr
Definition: ActionComposed.h:48
Utils.h
ROSEE::ActionComposed::print
virtual void print() const override
Print info about this action (name, jointpos, inner actions names, and other)
Definition: ActionComposed.cpp:176
ROSEE::ActionComposed::independent
bool independent
Definition: ActionComposed.h:116
ROSEE::ActionComposed::sumAction
virtual bool sumAction(ROSEE::Action::Ptr action, double jointPosScaleFactor=1.0, unsigned int jointPosIndex=0)
Function to add another action to this one.
Definition: ActionComposed.cpp:56
ROSEE::ActionComposed::ConstPtr
std::shared_ptr< const ActionComposed > ConstPtr
Definition: ActionComposed.h:49
ROSEE::ActionComposed::isIndependent
bool isIndependent() const
Definition: ActionComposed.cpp:43
ROSEE::Action::Ptr
std::shared_ptr< Action > Ptr
Definition: Action.h:75
ROSEE::ActionComposed::getInnerActionsNames
std::vector< std::string > getInnerActionsNames() const
Definition: ActionComposed.cpp:47
ROSEE::ActionComposed::fillFromYaml
virtual bool fillFromYaml(YAML::const_iterator yamlIt) override
Fill the internal data with infos taken from yaml file.
Definition: ActionComposed.cpp:234
ROSEE::ActionComposed::emitYaml
virtual void emitYaml(YAML::Emitter &out) const override
Emit info in a file with yaml format.
Definition: ActionComposed.cpp:208
ROSEE::Action::name
std::string name
Definition: Action.h:146
ROSEE::ActionComposed
A ActionComposed, which is formed by one or more Primitives (or even other composed)....
Definition: ActionComposed.h:44


end-effector
Author(s): Luca Muratore , Davide Torielli , Liana Bertoni
autogenerated on Sat Dec 14 2024 03:49:26