BiKAC.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 ...
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#include <armarx/control/njoint_mp_controller/task_space/ControllerInterface.h>
30
32{
33 using namespace armarx::control::njoint_controller::task_space;
34 using namespace armarx::control::common;
35
37 {
38 int idx;
39 std::string type;
40 std::string mpName;
41
42 std::string rnsKpt;
43 std::string rnsFrame;
44
45 Eigen::Matrix4f poseDiffKptLocal;
46 Eigen::Matrix4f poseDiffFrameLocal;
47
48 Eigen::Vector3f pcaMeanLocal;
49 Eigen::Matrix3f pcaComponentsLocal;
50
51 Eigen::Matrix4f currentFrameRoot;
52 Eigen::Matrix4f currentKptPoseRoot;
53 Eigen::Matrix4f currentKptPoseLocal;
56
57 Eigen::Matrix4f targetKptPoseLocal;
58 Eigen::Matrix4f targetKptPoseRoot;
59 Eigen::Vector3f trackingForceLocal;
60 Eigen::Vector3f trackingForceRoot;
61
62 Eigen::Vector3f kptKp;
63 Eigen::Vector3f kptKd;
64
69 int p2pIdx;
70 };
71
80
82 {
86 std::map<std::string, AdmittanceData> admittanceData;
87 // std::map<std::string, std::vector<int>> rnsToConstraintIdxMap;
88 // std::map<std::string, Eigen::Vector6f> rnsToForceTorqueMap;
89 std::vector<Constraint> cList;
90 };
91
92 /**
93 * @defgroup Library-NJointBiKAC NJointBiKAC
94 * @ingroup Library-RobotUnit-NJointControllers
95 * A description of the library NJointBiKAC.
96 *
97 * @class NJointBiKAC
98 * @ingroup Library-NJointBiKAC
99 * @brief Brief description of class NJointBiKAC.
100 *
101 * Detailed description of class NJointBiKAC.
102 */
105 virtual public mp::MPPool,
106 virtual public NJointBiKACInterface
107 {
108 public:
109 using MPListConfig = common::mp::arondto::MPListConfig;
110
112 const NJointControllerConfigPtr& config,
114
115 std::string getClassName(const Ice::Current& = Ice::emptyCurrent) const override;
116
117 void updateMPConfig(const ::armarx::aron::data::dto::DictPtr& dto,
118 const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
120 getMPConfig(const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
121 void updateBiKACConfig(const ::armarx::aron::data::dto::DictPtr& dto,
122 const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
124 getBiKACConfig(const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
125
126 void additionalTask() override;
127
128 protected:
129 /// this variable is only needed when constructing the MP instances, therefore you don't
130 /// need to use triple buffers
133
134 protected:
135 // void reInitMPInputOutputData();
136 void limbNonRT(ArmPtr& arm);
137 void updateConstraintStatus(const bool rtSafe);
138
139 void onPublish(const SensorAndControl&,
141 const DebugObserverInterfacePrx&) override;
142
145
146 private:
147 // std::atomic<bool> isMPReady{false};
148 std::atomic<bool> isConstraintReady{false};
149 };
150} // namespace armarx::control::njoint_mp_controller::task_space
A simple triple buffer for lockfree comunication between a single writer and a single reader.
NJointTaskspaceImpedanceController(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
std::string getClassName(const Ice::Current &=Ice::emptyCurrent) const override
Definition BiKAC.cpp:45
void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &) override
Definition BiKAC.cpp:453
NJointBiKAC(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
Definition BiKAC.cpp:35
void updateMPConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition BiKAC.cpp:51
MPListConfig mpConfig
this variable is only needed when constructing the MP instances, therefore you don't need to use trip...
Definition BiKAC.h:131
void updateBiKACConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition BiKAC.cpp:96
::armarx::aron::data::dto::DictPtr getBiKACConfig(const Ice::Current &iceCurrent=Ice::emptyCurrent) override
Definition BiKAC.cpp:186
armarx::aron::data::dto::Dict getMPConfig()
Matrix< float, 6, 1 > Vector6f
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
::IceInternal::Handle< Dict > DictPtr
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class RobotUnit > RobotUnitPtr
Definition FTSensor.h:34
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
detail::ControlThreadOutputBufferEntry SensorAndControl
std::map< std::string, AdmittanceData > admittanceData
Definition BiKAC.h:86