mbsim  4.0.0
MBSim Kernel
generalized_position_constraint.h
1/* Copyright (C) 2004-2009 MBSim Development Team
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 *
16 * Contact: martin.o.foerg@googlemail.com
17 */
18
19#ifndef _GENERALIZED_POSITION_CONSTRAINT_H
20#define _GENERALIZED_POSITION_CONSTRAINT_H
21
22#include "mbsim/constraints/generalized_dual_constraint.h"
23#include "mbsim/functions/function.h"
24
25namespace MBSim {
26
28
29 public:
30 GeneralizedPositionConstraint(const std::string &name="") : GeneralizedDualConstraint(name), f(nullptr) { }
31 ~GeneralizedPositionConstraint() override { delete f; }
32
33 void init(Element::InitStage stage, const InitConfigSet &config) override;
34
35 void setConstraintFunction(Function<fmatvec::VecV(double)>* f_) {
36 f = f_;
37 f->setParent(this);
38 f->setName("Constraint");
39 }
40
41 void setUpInverseKinetics() override;
42
43 void updateGeneralizedCoordinates() override;
44 void updateGeneralizedJacobians(int j=0) override;
45
46 void initializeUsingXML(xercesc::DOMElement * element) override;
47
48 private:
49 Function<fmatvec::VecV(double)> *f;
50 };
51
52}
53
54#endif
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
void setName(const std::string &str)
Definition: element.h:115
Definition: function.h:53
Class for dual generalized constraints.
Definition: generalized_dual_constraint.h:32
Definition: generalized_position_constraint.h:27
void init(Element::InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: generalized_position_constraint.cc:35
namespace MBSim
Definition: bilateral_constraint.cc:30