NaturalIKTest.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 RobotAPI::ArmarXObjects::NaturalIKTest
17  * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
27 
28 #include <ArmarXCore/interface/observers/ObserverInterface.h>
29 
31 //#include <RobotAPI/libraries/core/visualization/DebugDrawerTopic.h>
32 #include <Eigen/Dense>
33 
35 
37 
38 
39 namespace armarx
40 {
41  /**
42  * @class NaturalIKTestPropertyDefinitions
43  * @brief
44  */
47  {
48  public:
50  };
51 
52 
53 
54  /**
55  * @defgroup Component-NaturalIKTest NaturalIKTest
56  * @ingroup RobotAPI-Components
57  * A description of the component NaturalIKTest.
58  *
59  * @class NaturalIKTest
60  * @ingroup Component-NaturalIKTest
61  * @brief Brief description of class NaturalIKTest.
62  *
63  * Detailed description of class NaturalIKTest.
64  */
65  class NaturalIKTest :
66  virtual public armarx::Component,
67  virtual public RemoteGuiComponentPluginUser
68  {
69  public:
70 
72  {
73  Eigen::Vector3f target;
74  Eigen::Vector3f targetRotation;
75  float scale = 1.3f;
76  float minElbZ;
77  std::atomic_bool setOri;
79  };
80 
81  struct GuiParams
82  {
85  std::atomic_bool targetValid = false;
86  Eigen::Vector3f err_R = Eigen::Vector3f::Zero(), err_L = Eigen::Vector3f::Zero();
87 
88  std::atomic_bool useCompositeIK;
89 
90  };
91 
92  /// @see armarx::ManagedIceObject::getDefaultName()
93  virtual std::string getDefaultName() const override;
94 
95 
98  protected:
99 
100  /// @see armarx::ManagedIceObject::onInitComponent()
101  virtual void onInitComponent() override;
102 
103  /// @see armarx::ManagedIceObject::onConnectComponent()
104  virtual void onConnectComponent() override;
105 
106  /// @see armarx::ManagedIceObject::onDisconnectComponent()
107  virtual void onDisconnectComponent() override;
108 
109  /// @see armarx::ManagedIceObject::onExitComponent()
110  virtual void onExitComponent() override;
111 
112  /// @see PropertyUser::createPropertyDefinitions()
114 
115  void vizTaskRun();
116  void testTaskRun();
119 
120 
121  private:
122 
123  // Private methods and member variables go here.
124 
125  /// Debug observer. Used to visualize e.g. time series.
126  armarx::DebugObserverInterfacePrx debugObserver;
127  /// Debug drawer. Used for 3D visualization.
128  //armarx::DebugDrawerTopic debugDrawer;
129 
132  GuiParams p;
133  };
134 }
NaturalDiffIK.h
armarx::NaturalIK::Parameters
Definition: NaturalIK.h:52
armarx::NaturalIKTest::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: NaturalIKTest.cpp:934
armarx::NaturalIKTestPropertyDefinitions
Definition: NaturalIKTest.h:45
armarx::NaturalIKTest::onExitComponent
virtual void onExitComponent() override
Definition: NaturalIKTest.cpp:926
armarx::NaturalIKTest
Brief description of class NaturalIKTest.
Definition: NaturalIKTest.h:65
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::NaturalIKTest::mirrorPose
Eigen::Matrix4f mirrorPose(Eigen::Matrix4f oldPose)
Definition: NaturalIKTest.cpp:894
armarx::NaturalIKTest::GuiParams::targetValid
std::atomic_bool targetValid
Definition: NaturalIKTest.h:85
armarx::NaturalIKTest::onDisconnectComponent
virtual void onDisconnectComponent() override
Definition: NaturalIKTest.cpp:97
armarx::NaturalIKTest::GuiSideParams::ikparams
NaturalIK::Parameters ikparams
Definition: NaturalIKTest.h:78
armarx::NaturalIKTest::GuiSideParams::minElbZ
float minElbZ
Definition: NaturalIKTest.h:76
armarx::NaturalIKTest::mirrorOri
Eigen::Quaternionf mirrorOri(Eigen::Quaternionf oriOld)
Definition: NaturalIKTest.cpp:912
armarx::NaturalIKTest::testTaskRun
void testTaskRun()
Definition: NaturalIKTest.cpp:301
armarx::NaturalIKTest::GuiParams::err_L
Eigen::Vector3f err_L
Definition: NaturalIKTest.h:86
armarx::RemoteGui::TabProxy
Definition: WidgetProxy.h:17
armarx::NaturalIKTest::GuiParams
Definition: NaturalIKTest.h:81
armarx::NaturalIKTest::GuiSideParams::scale
float scale
Definition: NaturalIKTest.h:75
armarx::NaturalIKTest::GuiSideParams::setOri
std::atomic_bool setOri
Definition: NaturalIKTest.h:77
armarx::NaturalIKTest::GuiSideParams::targetRotation
Eigen::Vector3f targetRotation
Definition: NaturalIKTest.h:74
armarx::NaturalIKTest::GuiSideParams
Definition: NaturalIKTest.h:71
armarx::NaturalIKTest::GuiParams::err_R
Eigen::Vector3f err_R
Definition: NaturalIKTest.h:86
armarx::NaturalIKTest::GuiParams::p_R
GuiSideParams p_R
Definition: NaturalIKTest.h:83
armarx::RemoteGuiComponentPluginUser
Definition: RemoteGuiComponentPlugin.h:240
armarx::NaturalIKTest::vizTaskRun
void vizTaskRun()
Definition: NaturalIKTest.cpp:577
armarx::NaturalIKTest::onConnectComponent
virtual void onConnectComponent() override
Definition: NaturalIKTest.cpp:80
armarx::NaturalIKTest::GuiParams::p_L
GuiSideParams p_L
Definition: NaturalIKTest.h:84
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::NaturalIKTest::buildGui
RemoteGui::WidgetPtr buildGui()
Definition: NaturalIKTest.cpp:103
armarx::WidgetDescription::WidgetPtr
::IceInternal::Handle<::armarx::WidgetDescription::Widget > WidgetPtr
Definition: NJointControllerBase.h:66
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::NaturalIKTest::getDefaultName
virtual std::string getDefaultName() const override
Definition: NaturalIKTest.cpp:61
armarx::NaturalIKTest::GuiSideParams::target
Eigen::Vector3f target
Definition: NaturalIKTest.h:73
armarx::NaturalIKTest::onInitComponent
virtual void onInitComponent() override
Definition: NaturalIKTest.cpp:67
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
armarx::Quaternion< float, 0 >
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::NaturalIKTest::processGui
void processGui(RemoteGui::TabProxy &prx)
Definition: NaturalIKTest.cpp:178
armarx::NaturalIKTestPropertyDefinitions::NaturalIKTestPropertyDefinitions
NaturalIKTestPropertyDefinitions(std::string prefix)
Definition: NaturalIKTest.cpp:48
armarx::NaturalIKTest::GuiParams::useCompositeIK
std::atomic_bool useCompositeIK
Definition: NaturalIKTest.h:88
RemoteGuiComponentPlugin.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
NaturalIK.h