RetrieveHand.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package control::ArmarXObjects::retrieve_hand
17  * @author Jianfeng Gao ( jianfeng dot gao at kit dot edu )
18  * @date 2023
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
29 
31 {
32  /**
33  * @defgroup Library-retrieve_hand retrieve_hand
34  * @ingroup control
35  * A description of the library retrieve_hand.
36  *
37  * @class retrieve_hand
38  * @ingroup Library-retrieve_hand
39  * @brief Brief description of class retrieve_hand.
40  *
41  * Detailed description of class retrieve_hand.
42  */
44  {
45  public:
46  struct Remote
47  {
48  // armarx::viz::Client arviz;
50 
52  };
53 
54  struct Properties
55  {
56  std::string robotName;
57  std::string robotNodeSet;
59  // Eigen::Matrix4f targetPoseInRoot;
61  float kpLinear = 10.0f;
62  float kpAngular = 10.0f;
63  float kdLinear = 1.0f;
64  float kdAngular = 1.0f;
65 
66  std::vector<std::string> fileNames;
67  };
68 
69  struct Subskills
70  {
71  std::function<bool(const Eigen::Vector3f&)> lookAt;
72  std::function<bool()> openHand;
73  std::function<bool()> closeHand;
74  };
75 
76  RetrieveHand(const Remote&, const Properties&);
77  virtual ~RetrieveHand() = default;
78 
79  void
80  stop()
81  {
82  running.store(false);
83  _deleteTSVMPController();
84  }
85 
86  bool
88  {
89  std::scoped_lock l(executionMutex);
90  running.store(true);
91  return _runTSVMPController();
92  }
93 
94  protected:
97 
98  private:
99  bool _runTSVMPController();
100  void _deleteTSVMPController();
101  mutable std::mutex executionMutex;
102  std::atomic_bool running = false;
103  };
104 
105 } // namespace armarx::control::retrieve_hand::core
armarx::control::retrieve_hand::core::RetrieveHand::Remote::robotUnit
armarx::RobotUnitInterfacePrx robotUnit
Definition: RetrieveHand.h:51
armarx::control::retrieve_hand::core
Definition: RetrieveHand.cpp:31
armarx::control::retrieve_hand::core::RetrieveHand::Properties::timeDurationInSec
double timeDurationInSec
Definition: RetrieveHand.h:58
armarx::FramedPose
The FramedPose class.
Definition: FramedPose.h:280
armarx::control::retrieve_hand::core::RetrieveHand::Properties::kpAngular
float kpAngular
Definition: RetrieveHand.h:62
armarx::control::retrieve_hand::core::RetrieveHand::stop
void stop()
Definition: RetrieveHand.h:80
armarx::control::retrieve_hand::core::RetrieveHand::Remote
Definition: RetrieveHand.h:46
armarx::control::retrieve_hand::core::RetrieveHand::Properties::robotNodeSet
std::string robotNodeSet
Definition: RetrieveHand.h:57
armarx::control::retrieve_hand::core::RetrieveHand::Subskills::openHand
std::function< bool()> openHand
Definition: RetrieveHand.h:72
armarx::control::retrieve_hand::core::RetrieveHand::Properties::fileNames
std::vector< std::string > fileNames
Definition: RetrieveHand.h:66
armarx::control::retrieve_hand::core::RetrieveHand::Properties::kpLinear
float kpLinear
Definition: RetrieveHand.h:61
armarx::control::retrieve_hand::core::RetrieveHand::Subskills::lookAt
std::function< bool(const Eigen::Vector3f &)> lookAt
Definition: RetrieveHand.h:71
armarx::control::retrieve_hand::core::RetrieveHand::execute
bool execute()
Definition: RetrieveHand.h:87
armarx::control::retrieve_hand::core::RetrieveHand::properties
Properties properties
Definition: RetrieveHand.h:96
armarx::control::retrieve_hand::core::RetrieveHand::Remote::memoryNameSystem
armarx::armem::client::MemoryNameSystem memoryNameSystem
Definition: RetrieveHand.h:49
VirtualRobotReader.h
armarx::control::retrieve_hand::core::RetrieveHand::Properties
Definition: RetrieveHand.h:54
armarx::control::retrieve_hand::core::RetrieveHand::Properties::kdLinear
float kdLinear
Definition: RetrieveHand.h:63
armarx::control::retrieve_hand::core::RetrieveHand::remote
Remote remote
Definition: RetrieveHand.h:95
armarx::control::retrieve_hand::core::RetrieveHand::RetrieveHand
RetrieveHand(const Remote &, const Properties &)
Definition: RetrieveHand.cpp:35
Robot.h
Reader.h
armarx::control::retrieve_hand::core::RetrieveHand::Subskills
Definition: RetrieveHand.h:69
IceInternal::ProxyHandle<::IceProxy::armarx::RobotUnitInterface >
armarx::control::retrieve_hand::core::RetrieveHand::Properties::robotName
std::string robotName
Definition: RetrieveHand.h:56
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:68
armarx::control::retrieve_hand::core::RetrieveHand::Properties::targetPose
armarx::FramedPose targetPose
Definition: RetrieveHand.h:60
armarx::control::retrieve_hand::core::RetrieveHand
Definition: RetrieveHand.h:43
armarx::control::retrieve_hand::core::RetrieveHand::Subskills::closeHand
std::function< bool()> closeHand
Definition: RetrieveHand.h:73
armarx::control::retrieve_hand::core::RetrieveHand::Properties::kdAngular
float kdAngular
Definition: RetrieveHand.h:64
Writer.h
armarx::control::retrieve_hand::core::RetrieveHand::~RetrieveHand
virtual ~RetrieveHand()=default