DART  6.6.2
Marker.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2018, 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_MARKER_HPP_
34 #define DART_DYNAMICS_MARKER_HPP_
35 
36 #include <Eigen/Dense>
40 
41 namespace dart {
42 namespace dynamics {
43 
44 class BodyNode;
45 
46 class Marker final :
48  Marker, detail::MarkerProperties,
49  FixedJacobianNode>
50 {
51 public:
52 
57 
59  NameAspect,
60  FixedFrame,
61  Marker>;
62 
64 
66  virtual ~Marker() = default;
67 
70 
74  DART_DEPRECATED(6.0)
76 
80  DART_DEPRECATED(6.0)
81  const BodyNode* getBodyNode() const;
82 
84  Eigen::Vector3d getLocalPosition() const;
85 
87  void setLocalPosition(const Eigen::Vector3d& offset);
88 
90  Eigen::Vector3d getWorldPosition() const;
91 
93  int getID() const;
94 
97 
100 
102  void setColor(const Eigen::Vector4d& color);
103 
105  const Eigen::Vector4d& getColor() const;
106 
107  friend class BodyNode;
108 
109 protected:
110 
112  Marker(BodyNode* parent, const BasicProperties& properties);
113 
114  // Documentation inherited
115  Node* cloneNode(BodyNode* parent) const override;
116 
117 private:
119  int mID;
120 
122  static int msMarkerCount;
123 
124 };
125 
126 } // namespace dynamics
127 } // namespace dart
128 
129 #endif // DART_DYNAMICS_MARKER_HPP_
#define DART_DEPRECATED(version)
Definition: Deprecated.hpp:51
BodyPropPtr properties
Definition: SdfParser.cpp:80
std::string type
Definition: SdfParser.cpp:82
detail::CompositeProperties Properties
Definition: Composite.hpp:56
This is an alternative to EmbedProperties which allows your class to also inherit other Composite obj...
Definition: EmbeddedAspect.hpp:248
typename Impl::AspectProperties AspectProperties
Definition: EmbeddedAspect.hpp:254
Definition: CompositeData.hpp:180
Definition: CompositeData.hpp:104
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:78
The FixedFrame class represents a Frame with zero relative velocity and zero relative acceleration.
Definition: FixedFrame.hpp:52
Definition: Marker.hpp:50
Eigen::Vector3d getLocalPosition() const
Get position of this marker in the parent body node coordinates.
Definition: Marker.cpp:81
Node * cloneNode(BodyNode *parent) const override
Definition: Marker.cpp:153
void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this Marker.
Definition: Marker.cpp:62
Eigen::Vector3d getWorldPosition() const
Get position in the world coordinates.
Definition: Marker.cpp:95
BodyNode * getBodyNode()
Get the BodyNode this Marker belongs to.
Definition: Marker.cpp:69
int mID
Unique ID of this marker globally.
Definition: Marker.hpp:119
static constexpr ConstraintType NO
Definition: Marker.hpp:54
static constexpr ConstraintType SOFT
Definition: Marker.hpp:56
virtual ~Marker()=default
Destructor.
void setColor(const Eigen::Vector4d &color)
Set the color of this Marker.
Definition: Marker.cpp:123
ConstraintType getConstraintType() const
Get constraint type. which will be useful for inverse kinematics.
Definition: Marker.cpp:117
const Eigen::Vector4d & getColor() const
Return color of this Marker.
Definition: Marker.cpp:133
static constexpr ConstraintType HARD
Definition: Marker.hpp:55
void setLocalPosition(const Eigen::Vector3d &offset)
Set position of this marker in the parent body node coordinates.
Definition: Marker.cpp:87
static int msMarkerCount
Counts the number of markers globally.
Definition: Marker.hpp:122
void setConstraintType(ConstraintType type)
Set constraint type. which will be useful for inverse kinematics.
Definition: Marker.cpp:107
int getID() const
Get global unique ID.
Definition: Marker.cpp:101
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition: Node.hpp:84
Definition: MathTypes.hpp:47
Definition: BulletCollisionDetector.cpp:63
ConstraintType
Definition: MarkerAspect.hpp:46
@ SOFT
Definition: MarkerAspect.hpp:49
@ HARD
Definition: MarkerAspect.hpp:48
@ NO
Definition: MarkerAspect.hpp:47