DART 6.10.1
Loading...
Searching...
No Matches
Marker.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_MARKER_HPP_
34#define DART_DYNAMICS_MARKER_HPP_
35
36#include <Eigen/Dense>
40
41namespace dart {
42namespace dynamics {
43
44class BodyNode;
45
47 Marker,
48 detail::MarkerProperties,
49 FixedJacobianNode>
50{
51public:
56
59
61
63 virtual ~Marker() = default;
64
67
73
78 const BodyNode* getBodyNode() const;
79
81 Eigen::Vector3d getLocalPosition() const;
82
84 void setLocalPosition(const Eigen::Vector3d& offset);
85
87 Eigen::Vector3d getWorldPosition() const;
88
90 int getID() const;
91
94
97
99 void setColor(const Eigen::Vector4d& color);
100
102 const Eigen::Vector4d& getColor() const;
103
104 friend class BodyNode;
105
106protected:
108 Marker(BodyNode* parent, const BasicProperties& properties);
109
110 // Documentation inherited
111 Node* cloneNode(BodyNode* parent) const override;
112
113private:
115 int mID;
116
118 static int msMarkerCount;
119};
120
121} // namespace dynamics
122} // namespace dart
123
124#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:240
typename Impl::AspectProperties AspectProperties
Definition EmbeddedAspect.hpp:245
Definition CompositeData.hpp:186
Definition CompositeData.hpp:107
BodyNode class represents a single node of the skeleton.
Definition BodyNode.hpp:79
Definition Marker.hpp:50
Eigen::Vector3d getLocalPosition() const
Get position of this marker in the parent body node coordinates.
Definition Marker.cpp:80
Node * cloneNode(BodyNode *parent) const override
Definition Marker.cpp:153
void setAspectProperties(const AspectProperties &properties)
Set the AspectProperties of this Marker.
Definition Marker.cpp:61
Eigen::Vector3d getWorldPosition() const
Get position in the world coordinates.
Definition Marker.cpp:94
BodyNode * getBodyNode()
Get the BodyNode this Marker belongs to.
Definition Marker.cpp:68
int mID
Unique ID of this marker globally.
Definition Marker.hpp:115
static constexpr ConstraintType NO
Definition Marker.hpp:53
static constexpr ConstraintType SOFT
Definition Marker.hpp:55
virtual ~Marker()=default
Destructor.
void setColor(const Eigen::Vector4d &color)
Set the color of this Marker.
Definition Marker.cpp:122
ConstraintType getConstraintType() const
Get constraint type. which will be useful for inverse kinematics.
Definition Marker.cpp:116
const Eigen::Vector4d & getColor() const
Return color of this Marker.
Definition Marker.cpp:132
static constexpr ConstraintType HARD
Definition Marker.hpp:54
void setLocalPosition(const Eigen::Vector3d &offset)
Set position of this marker in the parent body node coordinates.
Definition Marker.cpp:86
static int msMarkerCount
Counts the number of markers globally.
Definition Marker.hpp:118
void setConstraintType(ConstraintType type)
Set constraint type. which will be useful for inverse kinematics.
Definition Marker.cpp:106
int getID() const
Get global unique ID.
Definition Marker.cpp:100
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition Node.hpp:81
Definition Random-impl.hpp:92
Definition BulletCollisionDetector.cpp:65
ConstraintType
Definition MarkerAspect.hpp:46
@ SOFT
Definition MarkerAspect.hpp:49
@ HARD
Definition MarkerAspect.hpp:48
@ NO
Definition MarkerAspect.hpp:47