TSMP.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 "MP.h"
29
31{
32
33 struct TSMPInput : virtual MPInput
34 {
35 Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();
36 Eigen::Vector6f vel = Eigen::Vector6f::Zero();
37 double deltaT;
38 };
39
40 struct TSMPOutput : virtual MPOutput
41 {
42 Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();
43 Eigen::Vector6f vel = Eigen::Vector6f::Zero();
44 };
45
46 using TSMPInputPtr = std::shared_ptr<TSMPInput>;
47 using TSMPOutputPtr = std::shared_ptr<TSMPOutput>;
48
49 class TSMP : virtual public MP
50 {
51 public:
52 TSMP(const MPConfig& c);
53 ~TSMP(){};
54
55 void computePhaseStop(const MPInputPtr input,
56 const MPOutputPtr output,
57 PhaseStopResult& phase) override;
58 void run(MPInputPtr, MPOutputPtr, const PhaseStopResult& phase) override;
59 void validateInitialState(const DVec& starts) override;
60 DVec validateViaPoint(const DVec& viapoint) override;
61
62 Eigen::Quaterniond previousAngularVelocity = Eigen::Quaterniond::Identity();
63
64 bool isDisturbance = false;
65 };
66
67 typedef std::shared_ptr<TSMP> TSMPPtr;
68
69} // namespace armarx::control::common::mp
constexpr T c
MP(const MPConfig &c)
Definition MP.cpp:17
void validateInitialState(const DVec &starts) override
Definition TSMP.cpp:35
void computePhaseStop(const MPInputPtr input, const MPOutputPtr output, PhaseStopResult &phase) override
Definition TSMP.cpp:55
TSMP(const MPConfig &c)
Definition TSMP.cpp:15
DVec validateViaPoint(const DVec &viapoint) override
Definition TSMP.cpp:43
void run(MPInputPtr, MPOutputPtr, const PhaseStopResult &phase) override
Definition TSMP.cpp:106
Eigen::Quaterniond previousAngularVelocity
Definition TSMP.h:62
Quaternion< double, 0 > Quaterniond
Matrix< float, 6, 1 > Vector6f
This file is part of ArmarX.
std::shared_ptr< TSMPOutput > TSMPOutputPtr
Definition TSMP.h:47
Ice::DoubleSeq DVec
Definition MP.h:53
std::shared_ptr< MPInput > MPInputPtr
Definition MP.h:70
std::shared_ptr< TSMPInput > TSMPInputPtr
Definition TSMP.h:46
std::shared_ptr< MPOutput > MPOutputPtr
Definition MP.h:71
std::shared_ptr< TSMP > TSMPPtr
Definition TSMP.h:67