DART  6.7.3
EndEffector.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019, 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_ENDEFFECTOR_HPP_
34 #define DART_DYNAMICS_ENDEFFECTOR_HPP_
35 
36 #include "dart/common/Aspect.hpp"
42 
43 namespace dart {
44 namespace dynamics {
45 
46 class BodyNode;
47 class Skeleton;
48 class EndEffector;
49 
50 //==============================================================================
51 class Support final :
53  Support,
54  detail::SupportStateData,
55  detail::SupportPropertiesData,
56  EndEffector,
57  &detail::SupportUpdate>
58 {
59 public:
60 
62 
63 
67  // void setGeometry(const math::SupportGeometry&);
68  // const math::SupportGeometry& getGeometry() const;
69 
72  void setActive(bool _supporting = true);
73 
75  bool isActive() const;
76 
77 };
78 
79 //==============================================================================
80 class EndEffector final :
81  public common::EmbedPropertiesOnTopOf<
82  EndEffector, detail::EndEffectorProperties,
84 {
85 public:
86 
87  friend class Skeleton;
88  friend class BodyNode;
89 
91 
93  NameAspect,
94  FixedFrame,
95  EndEffector>;
96 
98 
100  virtual ~EndEffector() = default;
101 
102  //----------------------------------------------------------------------------
104  //----------------------------------------------------------------------------
105 
108  void setProperties(const BasicProperties& _properties);
109 
112  void setProperties(const UniqueProperties& properties, bool useNow=false);
113 
115  void setAspectProperties(const AspectProperties& properties);
116 
118  Properties getEndEffectorProperties() const;
119 
121  void copy(const EndEffector& _otherEndEffector);
122 
124  void copy(const EndEffector* _otherEndEffector);
125 
127  EndEffector& operator=(const EndEffector& _otherEndEffector);
128 
133  void setDefaultRelativeTransform(const Eigen::Isometry3d& _newDefaultTf,
134  bool _useNow = false);
135 
139  void resetRelativeTransform();
140 
142 
143  //----------------------------------------------------------------------------
145  //----------------------------------------------------------------------------
146 
147  // Documentation inherited
148  void dirtyTransform() override;
149 
151 
152 protected:
153 
155  explicit EndEffector(BodyNode* parent, const BasicProperties& properties);
156 
157  // Documentation inherited
158  Node* cloneNode(BodyNode* _parent) const override;
159 
160 };
161 
162 } // namespace dynamics
163 } // namespace dart
164 
165 
166 #endif // DART_DYNAMICS_ENDEFFECTOR_HPP_
#define DART_COMMON_SET_GET_ASPECT_PROPERTY(Type, Name)
Definition: Aspect.hpp:189
#define DART_COMMON_ASPECT_STATE_PROPERTY_CONSTRUCTORS(ClassName)
Definition: Aspect.hpp:167
BodyPropPtr properties
Definition: SdfParser.cpp:80
Definition: AspectWithVersion.hpp:68
detail::CompositeProperties Properties
Definition: Composite.hpp:56
void setAspectProperties(const Aspect::Properties &someProperties) override final
Definition: AspectWithVersion.hpp:270
void setProperties(const PropertiesData &properties)
Set the Properties of this Aspect.
Definition: AspectWithVersion.hpp:291
Definition: CompositeData.hpp:180
Definition: CompositeData.hpp:104
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:78
Definition: EndEffector.hpp:84
virtual ~EndEffector()=default
Destructor.
The FixedFrame class represents a Frame with zero relative velocity and zero relative acceleration.
Definition: FixedFrame.hpp:52
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition: Node.hpp:84
class Skeleton
Definition: Skeleton.hpp:59
Definition: EndEffector.hpp:58
bool isActive() const
Get whether this EndEffector is currently being used for support.
Definition: EndEffector.cpp:69
void setActive(bool _supporting=true)
Pass in true if this EndEffector should be used to support the robot, like a foot.
Definition: EndEffector.cpp:59
#define DART_BAKE_SPECIALIZED_ASPECT(AspectName)
Definition: Composite.hpp:226
CompositeNode< common::CompositeJoiner< FixedJacobianNode, common::SpecializedForAspect< Support > > > EndEffectorCompositeBase
Definition: EndEffectorAspect.hpp:99
std::vector< Eigen::Vector3d > SupportGeometry
Definition: Geometry.hpp:496
Definition: BulletCollisionDetector.cpp:63
Definition: EndEffectorAspect.hpp:50