DART 6.12.2
Loading...
Searching...
No Matches
ConfigurationSpace.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_MATH_CONFIGURATIONSPACE_HPP_
34#define DART_MATH_CONFIGURATIONSPACE_HPP_
35
36#include <Eigen/Dense>
37
40
41namespace dart {
42namespace math {
43
44//==============================================================================
45template <std::size_t Dimension>
47{
48 static constexpr std::size_t NumDofs = Dimension;
49 static constexpr int NumDofsEigen = static_cast<int>(Dimension);
50
52
53 using Point = Eigen::Matrix<double, NumDofs, 1>;
54 using EuclideanPoint = Eigen::Matrix<double, NumDofs, 1>;
55 using Vector = Eigen::Matrix<double, NumDofs, 1>;
56 using Matrix = Eigen::Matrix<double, NumDofs, NumDofs>;
57 using JacobianMatrix = Eigen::Matrix<double, 6, NumDofs>;
58};
59
60//==============================================================================
61//
62// These namespace-level definitions are required to enable ODR-use of static
63// constexpr member variables.
64//
65// See this StackOverflow answer: http://stackoverflow.com/a/14396189/111426
66//
67template <std::size_t Dimension>
68constexpr std::size_t RealVectorSpace<Dimension>::NumDofs;
69template <std::size_t Dimension>
71
76
77//==============================================================================
79{
80 static constexpr std::size_t NumDofs = 3u;
81 static constexpr int NumDofsEigen = 3;
82
84
85 using Point = Eigen::Matrix3d;
86 using EuclideanPoint = Eigen::Vector3d;
87 using Vector = Eigen::Vector3d;
88 using Matrix = Eigen::Matrix3d;
89 using JacobianMatrix = Eigen::Matrix<double, 6, NumDofs>;
90};
91
92//==============================================================================
94{
95 static constexpr std::size_t NumDofs = 6u;
96 static constexpr int NumDofsEigen = 6;
97
99
100 using Point = Eigen::Isometry3d;
105};
106
108{
109};
110
111//==============================================================================
112template <typename SpaceT>
113typename SpaceT::Matrix inverse(const typename SpaceT::Matrix& mat);
114
115//==============================================================================
116template <typename SpaceT>
117typename SpaceT::EuclideanPoint toEuclideanPoint(
118 const typename SpaceT::Point& point);
119
120//==============================================================================
121template <typename SpaceT>
122typename SpaceT::Point toManifoldPoint(
123 const typename SpaceT::EuclideanPoint& point);
124
125//==============================================================================
126template <typename SpaceT>
127typename SpaceT::Point integratePosition(
128 const typename SpaceT::Point& pos,
129 const typename SpaceT::Vector& vel,
130 double dt);
131
132//==============================================================================
133template <typename SpaceT>
134typename SpaceT::Vector integrateVelocity(
135 const typename SpaceT::Vector& vel,
136 const typename SpaceT::Vector& acc,
137 double dt);
138
139} // namespace math
140} // namespace dart
141
143
144#endif // DART_MATH_CONFIGURATIONSPACE_HPP_
Matrix< double, 6, 1 > Vector6d
Definition MathTypes.hpp:49
Matrix< double, 6, 6 > Matrix6d
Definition MathTypes.hpp:50
SpaceT::Matrix inverse(const typename SpaceT::Matrix &mat)
Definition ConfigurationSpace.hpp:186
SpaceT::EuclideanPoint toEuclideanPoint(const typename SpaceT::Point &point)
Definition ConfigurationSpace.hpp:198
SpaceT::Point toManifoldPoint(const typename SpaceT::EuclideanPoint &point)
Definition ConfigurationSpace.hpp:206
SpaceT::Vector integrateVelocity(const typename SpaceT::Vector &vel, const typename SpaceT::Vector &acc, double dt)
Definition ConfigurationSpace.hpp:224
SpaceT::Point integratePosition(const typename SpaceT::Point &pos, const typename SpaceT::Vector &vel, double dt)
Definition ConfigurationSpace.hpp:214
Definition BulletCollisionDetector.cpp:60
Definition ConfigurationSpace.hpp:108
Definition ConfigurationSpace.hpp:47
Eigen::Matrix< double, NumDofs, NumDofs > Matrix
Definition ConfigurationSpace.hpp:56
Eigen::Matrix< double, NumDofs, 1 > Point
Definition ConfigurationSpace.hpp:53
Eigen::Matrix< double, NumDofs, 1 > Vector
Definition ConfigurationSpace.hpp:55
static constexpr int NumDofsEigen
Definition ConfigurationSpace.hpp:49
Eigen::Matrix< double, NumDofs, 1 > EuclideanPoint
Definition ConfigurationSpace.hpp:54
Eigen::Matrix< double, 6, NumDofs > JacobianMatrix
Definition ConfigurationSpace.hpp:57
static constexpr std::size_t NumDofs
Definition ConfigurationSpace.hpp:48
Definition ConfigurationSpace.hpp:94
Eigen::Vector6d EuclideanPoint
Definition ConfigurationSpace.hpp:101
static constexpr std::size_t NumDofs
Definition ConfigurationSpace.hpp:95
Eigen::Isometry3d Point
Definition ConfigurationSpace.hpp:100
static constexpr int NumDofsEigen
Definition ConfigurationSpace.hpp:96
Eigen::Matrix6d JacobianMatrix
Definition ConfigurationSpace.hpp:104
Eigen::Matrix6d Matrix
Definition ConfigurationSpace.hpp:103
Eigen::Vector6d Vector
Definition ConfigurationSpace.hpp:102
Definition ConfigurationSpace.hpp:79
static constexpr std::size_t NumDofs
Definition ConfigurationSpace.hpp:80
Eigen::Vector3d EuclideanPoint
Definition ConfigurationSpace.hpp:86
Eigen::Vector3d Vector
Definition ConfigurationSpace.hpp:87
static constexpr int NumDofsEigen
Definition ConfigurationSpace.hpp:81
Eigen::Matrix< double, 6, NumDofs > JacobianMatrix
Definition ConfigurationSpace.hpp:89
Eigen::Matrix3d Matrix
Definition ConfigurationSpace.hpp:88
Eigen::Matrix3d Point
Definition ConfigurationSpace.hpp:85