WipingMixImpVelColController.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 2024
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 #include <armarx/control/njoint_mp_controller/task_space/aron/WipingAdaptionConfig.aron.generated.h>
31 
33 {
35  using namespace armarx::control::common;
36 
37  /**
38  * @defgroup Library-NJointWipingMixImpVelColMPController NJointWipingMixImpVelColMPController
39  * @ingroup Library-RobotUnit-NJointControllers
40  * A description of the library NJointWipingMixImpVelColMPController.
41  *
42  * @class NJointWipingMixImpVelColMPController
43  * @ingroup Library-NJointWipingMixImpVelColMPController
44  * @brief Brief description of class NJointWipingMixImpVelColMPController.
45  *
46  * Detailed description of class NJointWipingMixImpVelColMPController.
47  */
50  virtual public mp::MPPool,
52  {
53  public:
55  {
56  float changeTimer = 0.0f;
57  Eigen::Vector2f lastPosition = Eigen::Vector2f::Zero();
58  Eigen::Vector6f kpImpedance = Eigen::Vector6f::Zero();
59  Eigen::Vector6f kpCartesianVel = Eigen::Vector6f::Zero();
61  Eigen::Vector2f lastDesiredUserPosition = Eigen::Vector2f::Identity();
62  float openDistanceToDesiredUserPosition = 0.;
63  };
64 
65  public:
66  using MPListConfig = common::mp::arondto::MPListConfig;
67 
69  const NJointControllerConfigPtr& config,
70  const VirtualRobot::RobotPtr&);
71 
72  std::string getClassName(const Ice::Current& = Ice::emptyCurrent) const override;
73 
74  void updateMPConfig(const ::armarx::aron::data::dto::DictPtr& dto,
75  const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
76  // ::armarx::aron::data::dto::DictPtr
77  // getMPConfig(const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
78 
79  void updateAdaptiveConfig(const ::armarx::aron::data::dto::DictPtr& dto,
80  const Ice::Current& iceCurrent = Ice::emptyCurrent) override;
81 
82  void additionalTask() override;
83 
84  // protected:
85  // /// this variable is only needed when constructing the MP instances, therefore you don't
86  // /// need to use triple buffers
87  // MPListConfig mpConfig;
88 
89  protected:
90  void rtPreActivateController() override;
91 
92  private:
93  std::atomic_bool adaptionReady{false};
94  arondto::WipingAdaptionConfigs adaptionCfg;
95  TripleBuffer<arondto::WipingAdaptionConfigs> bufferAdaptationConfigUserToNonRt;
96  std::map<std::string, AdaptionStatus> adaptionStatus;
97  };
98 } // namespace armarx::control::njoint_mp_controller::task_space
armarx::control::njoint_mp_controller::task_space::NJointWipingMixImpVelColMPController
Brief description of class NJointWipingMixImpVelColMPController.
Definition: WipingMixImpVelColController.h:48
armarx::control::njoint_mp_controller::task_space::NJointWipingMixImpVelColMPController::MPListConfig
common::mp::arondto::MPListConfig MPListConfig
Definition: WipingMixImpVelColController.h:66
TSMP.h
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
JSMP.h
armarx::control::njoint_controller::task_space
Definition: AdmittanceController.cpp:43
armarx::control::njoint_controller::task_space::NJointTaskspaceCollisionAvoidanceMixedImpedanceVelocityController
Brief description of class NJointTaskspaceCollisionAvoidanceMixedImpedanceVelocityController.
Definition: CollisionAvoidanceMixedImpedanceVelocityController.h:55
CollisionAvoidanceMixedImpedanceVelocityController.h
armarx::control::common
This file is part of ArmarX.
Definition: aron_conversions.cpp:29
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:570
armarx::control::njoint_mp_controller::task_space
This file is part of ArmarX.
Definition: AdmittanceController.cpp:29
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
IceUtil::Handle< class RobotUnit >
armarx::control::common::mp::MPPool
Definition: MPPool.h:47
Eigen::Matrix< float, 6, 1 >
MPPool.h
armarx::control::njoint_mp_controller::task_space::NJointWipingMixImpVelColMPController::AdaptionStatus
Definition: WipingMixImpVelColController.h:54
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
armarx::control::NJointWipingMixImpVelColMPControllerInterface
Definition: ControllerInterface.ice:93
armarx::TripleBuffer< arondto::WipingAdaptionConfigs >