JSMP.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 * @author Jianfeng Gao ( jianfeng dot gao at kit dot edu )
17 * @date 2022
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
25#include <ArmarXCore/interface/serialization/Eigen.h>
27
28#include <armarx/control/common/mp/aron/MPConfig.aron.generated.h>
29
30#include "MP.h"
31
33{
34 struct JSMPInput : virtual MPInput
35 {
36 Eigen::VectorXf angleRadian;
37 Eigen::VectorXf angularVel;
38 double deltaT;
39 };
40
41 struct JSMPOutput : virtual MPOutput
42 {
43 Eigen::VectorXf angleRadian;
44 Eigen::VectorXf angularVel;
45 };
46
47 using JSMPInputPtr = std::shared_ptr<JSMPInput>;
48 using JSMPOutputPtr = std::shared_ptr<JSMPOutput>;
49
50 class JSMP : virtual public MP
51 {
52 public:
53 JSMP(const arondto::MPConfig& c);
54 ~JSMP(){};
55
56 void run(MPInputPtr, MPOutputPtr, const PhaseStopResult& phase) override;
57
58 Eigen::Quaterniond previousAngularVelocity = Eigen::Quaterniond::Identity();
59 };
60
61 typedef std::shared_ptr<JSMP> JSMPPtr;
62
63} // namespace armarx::control::common::mp
constexpr T c
void run(MPInputPtr, MPOutputPtr, const PhaseStopResult &phase) override
Definition JSMP.cpp:31
JSMP(const arondto::MPConfig &c)
Definition JSMP.cpp:15
Eigen::Quaterniond previousAngularVelocity
Definition JSMP.h:58
MP(const MPConfig &c)
Definition MP.cpp:17
Quaternion< double, 0 > Quaterniond
This file is part of ArmarX.
std::shared_ptr< MPInput > MPInputPtr
Definition MP.h:70
std::shared_ptr< JSMPOutput > JSMPOutputPtr
Definition JSMP.h:48
std::shared_ptr< MPOutput > MPOutputPtr
Definition MP.h:71
std::shared_ptr< JSMP > JSMPPtr
Definition JSMP.h:61
std::shared_ptr< JSMPInput > JSMPInputPtr
Definition JSMP.h:47