DART  6.7.3
VskParser.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_UTILS_VSKPARSER_HPP_
34 #define DART_UTILS_VSKPARSER_HPP_
35 
37 #include "dart/common/Uri.hpp"
38 #include "dart/math/Constants.hpp"
40 
41 namespace dart {
42 namespace utils {
43 
44 namespace VskParser
45 {
50  struct Options
51  {
54 
59  Eigen::Vector3d defaultEllipsoidSize;
60 
65 
67  double density;
68 
71 
74 
77 
79  double jointFriction;
80 
83 
86  const Eigen::Vector3d& defaultEllipsoidSize
87  = Eigen::Vector3d::Constant(0.05),
88  double thicknessRatio = 0.35,
89  double density = 1e+3,
92  double jointDampingCoefficient = 0.1,
93  double jointFriction = 0.0,
94  bool removeEndBodyNodes = false);
95  };
96 
99  Options options = Options());
100 
101 } // namespace VskParser
102 
103 } // namespace utils
104 } // namespace dart
105 
106 #endif // #ifndef DART_UTILS_VSKPARSER_HPP_
107 
VskParser::Options options
Definition: VskParser.cpp:67
std::shared_ptr< ResourceRetriever > ResourceRetrieverPtr
Definition: ResourceRetriever.hpp:76
std::shared_ptr< Skeleton > SkeletonPtr
Definition: SmartPointer.hpp:60
dynamics::SkeletonPtr readSkeleton(const common::Uri &fileUri, Options options=Options())
Read Skeleton from VSK file.
Definition: VskParser.cpp:184
Definition: BulletCollisionDetector.cpp:63
The Uri struct provides URI parsing and merging functionality based on RFC 3986.
Definition: Uri.hpp:87
static constexpr T pi()
Definition: Constants.hpp:44
Options struct is additional information that helps building a skeleton that can be used in kinematic...
Definition: VskParser.hpp:51
double density
Density of each ellipsoid that are used to compute mass.
Definition: VskParser.hpp:67
bool removeEndBodyNodes
Remove end BodyNodes with no Shape segment.
Definition: VskParser.hpp:82
double jointDampingCoefficient
Joint damping coefficient.
Definition: VskParser.hpp:76
Options(const common::ResourceRetrieverPtr &retrieverOrNullptr=nullptr, const Eigen::Vector3d &defaultEllipsoidSize=Eigen::Vector3d::Constant(0.05), double thicknessRatio=0.35, double density=1e+3, double jointPositionLowerLimit=-math::constantsd::pi(), double jointPositionUpperLimit=+math::constantsd::pi(), double jointDampingCoefficient=0.1, double jointFriction=0.0, bool removeEndBodyNodes=false)
Constructor.
Definition: VskParser.cpp:160
double jointFriction
Joint Coulomb friction.
Definition: VskParser.hpp:79
double jointPositionLowerLimit
Lower limit of joint position.
Definition: VskParser.hpp:70
Eigen::Vector3d defaultEllipsoidSize
The default shape for body node is ellipsoid.
Definition: VskParser.hpp:59
common::ResourceRetrieverPtr retrieverOrNullptr
Resource retriever. LocalResourceRetriever is used if it's nullptr.
Definition: VskParser.hpp:53
double jointPositionUpperLimit
Upper limit of joint position.
Definition: VskParser.hpp:73
double thicknessRatio
Ratio of shorter radii of each ellipsoid to the longest radius where the longest radius is the distan...
Definition: VskParser.hpp:64