DART  6.10.1
TranslationalJoint2D.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_DYNAMICS_TRANSLATIONALJOINT2D_HPP_
34 #define DART_DYNAMICS_TRANSLATIONALJOINT2D_HPP_
35 
38 
39 namespace dart {
40 namespace dynamics {
41 
48 {
49 public:
50  friend class Skeleton;
55 
56  DART_BAKE_SPECIALIZED_ASPECT_IRREGULAR(Aspect, TranslationalJoint2DAspect)
57 
59 
61  virtual ~TranslationalJoint2D();
62 
64  void setProperties(const Properties& properties);
65 
68 
71 
74 
76  void copy(const TranslationalJoint2D& otherJoint);
77 
79  void copy(const TranslationalJoint2D* otherJoint);
80 
82  TranslationalJoint2D& operator=(const TranslationalJoint2D& otherJoint);
83 
84  // Documentation inherited
85  const std::string& getType() const override;
86 
88  static const std::string& getStaticType();
89 
90  // Documentation inherited
91  bool isCyclic(std::size_t index) const override;
92 
96  void setXYPlane(bool renameDofs = true);
97 
101  void setYZPlane(bool renameDofs = true);
102 
106  void setZXPlane(bool renameDofs = true);
107 
113  void setArbitraryPlane(
114  const Eigen::Vector3d& transAxis1,
115  const Eigen::Vector3d& transAxis2,
116  bool renameDofs = true);
117 
119  PlaneType getPlaneType() const;
120 
122  Eigen::Vector3d getTranslationalAxis1() const;
123 
125  Eigen::Vector3d getTranslationalAxis2() const;
126 
127  // Documentation inherited
128  Eigen::Matrix<double, 6, 2> getRelativeJacobianStatic(
129  const Eigen::Vector2d& positions) const override;
130 
131 protected:
133  explicit TranslationalJoint2D(const Properties& properties);
134 
135  // Documentation inherited
136  Joint* clone() const override;
137 
139 
140  // Documentation inherited
141  void updateDegreeOfFreedomNames() override;
142 
143  // Documentation inherited
144  void updateRelativeTransform() const override;
145 
146  // Documentation inherited
147  void updateRelativeJacobian(bool mandatory = true) const override;
148 
149  // Documentation inherited
150  void updateRelativeJacobianTimeDeriv() const override;
151 };
152 
153 } // namespace dynamics
154 } // namespace dart
155 
156 #endif // DART_DYNAMICS_TRANSLATIONALJOINT2D_HPP_
BodyPropPtr properties
Definition: SdfParser.cpp:80
std::size_t index
Definition: SkelParser.cpp:1672
Terminator for the variadic template.
Definition: CompositeJoiner.hpp:45
This is an alternative to EmbedProperties which allows your class to also inherit other Composite obj...
Definition: EmbeddedAspect.hpp:240
typename Impl::Aspect Aspect
Definition: EmbeddedAspect.hpp:246
typename Impl::AspectProperties AspectProperties
Definition: EmbeddedAspect.hpp:245
Definition: GenericJoint.hpp:48
class Joint
Definition: Joint.hpp:60
class Skeleton
Definition: Skeleton.hpp:59
TranslationalJoint2D represents a 2-dof joint, which has two orthogonal translational axes.
Definition: TranslationalJoint2D.hpp:48
void setYZPlane(bool renameDofs=true)
Sets plane type as YZ-plane.
Definition: TranslationalJoint2D.cpp:137
void updateRelativeJacobianTimeDeriv() const override
Definition: TranslationalJoint2D.cpp:250
void updateRelativeJacobian(bool mandatory=true) const override
Definition: TranslationalJoint2D.cpp:235
Eigen::Vector3d getTranslationalAxis1() const
Returns first translational axis.
Definition: TranslationalJoint2D.cpp:176
Eigen::Vector3d getTranslationalAxis2() const
Returns second translational axis.
Definition: TranslationalJoint2D.cpp:182
Properties getTranslationalJoint2DProperties() const
Returns the Properties of this TranslationalJoint2D.
Definition: TranslationalJoint2D.cpp:76
void setZXPlane(bool renameDofs=true)
Sets plane type as ZX-plane.
Definition: TranslationalJoint2D.cpp:147
Eigen::Matrix< double, 6, 2 > getRelativeJacobianStatic(const Eigen::Vector2d &positions) const override
Definition: TranslationalJoint2D.cpp:188
void copy(const TranslationalJoint2D &otherJoint)
Copies the Properties of another TranslationalJoint2D.
Definition: TranslationalJoint2D.cpp:82
const std::string & getType() const override
Definition: TranslationalJoint2D.cpp:108
void setProperties(const Properties &properties)
Sets the Properties of this TranslationalJoint2D.
Definition: TranslationalJoint2D.cpp:52
bool isCyclic(std::size_t index) const override
Definition: TranslationalJoint2D.cpp:121
Joint * clone() const override
Definition: TranslationalJoint2D.cpp:207
void setAspectProperties(const AspectProperties &properties)
Sets the AspectProperties of this TranslationalJoint2D.
Definition: TranslationalJoint2D.cpp:65
PlaneType getPlaneType() const
Returns plane type.
Definition: TranslationalJoint2D.cpp:170
void updateDegreeOfFreedomNames() override
Definition: TranslationalJoint2D.cpp:213
static const std::string & getStaticType()
Returns joint type for this class.
Definition: TranslationalJoint2D.cpp:114
void setArbitraryPlane(const Eigen::Vector3d &transAxis1, const Eigen::Vector3d &transAxis2, bool renameDofs=true)
Sets plane type as arbitrary plane with two orthogonal translational axes.
Definition: TranslationalJoint2D.cpp:157
void updateRelativeTransform() const override
Definition: TranslationalJoint2D.cpp:222
void setXYPlane(bool renameDofs=true)
Sets plane type as XY-plane.
Definition: TranslationalJoint2D.cpp:127
Definition: TranslationalJoint2DAspect.hpp:52
#define DART_BAKE_SPECIALIZED_ASPECT_IRREGULAR(TypeName, AspectName)
Definition: Composite.hpp:164
Definition: Random-impl.hpp:92
common::EmbedPropertiesOnTopOf< TranslationalJoint2D, TranslationalJoint2DUniqueProperties, GenericJoint< math::R2Space > > TranslationalJoint2DBase
Definition: TranslationalJoint2DAspect.hpp:134
PlaneType
Plane type.
Definition: PlanarJointAspect.hpp:50
RealVectorSpace< 2u > R2Space
Definition: ConfigurationSpace.hpp:73
Definition: BulletCollisionDetector.cpp:65
Definition: SharedLibraryManager.hpp:46
Definition: TranslationalJoint2DAspect.hpp:118