File: SDFExtension.hh

package info (click to toggle)
sdformat 6.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,412 kB
  • sloc: cpp: 19,828; python: 1,633; ruby: 311; ansic: 114; sh: 70; makefile: 16
file content (121 lines) | stat: -rw-r--r-- 3,565 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 * Copyright 2015 Open Source Robotics Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/

#ifndef _SDFORMAT_SDFEXTENSION_HH_
#define _SDFORMAT_SDFEXTENSION_HH_

#include <tinyxml.h>

#include <memory>
#include <string>
#include <vector>

#include <ignition/math/Pose3.hh>

#include "sdf/Types.hh"

namespace sdf
{
  /// \internal
  /// \brief A class for holding sdf extension elements in urdf
  class SDFExtension
  {
    /// \brief Constructor
    public: SDFExtension();

    /// \brief Copy constructor
    /// \param[in] _ge SDFExtension to copy.
    public: SDFExtension(const SDFExtension &_ge);

    /// \brief Destructor
    public: virtual ~SDFExtension() = default;

    // for reducing fixed joints and removing links
    public: std::string oldLinkName;
    public: ignition::math::Pose3d reductionTransform;

    // visual material
    public: std::string material;

    /// \brief blobs of xml to be copied into the visual sdf element
    public: std::vector<std::shared_ptr<TiXmlElement> > visual_blobs;

    /// \brief blobs of xml to be copied into the collision sdf element
    /// An example might be:
    /// <gazebo reference="link-1">
    ///   <collision>
    ///     <max_contacts>10</max_contacts>
    ///     <surface>
    ///       <contact>
    ///         <ode>
    ///           <kp>1e+06</kp>
    ///           <kd>100</kd>
    ///           <max_vel>100</max_vel>
    ///           <min_depth>0.001</min_depth>
    ///         </ode>
    ///       </contact>
    ///       <friction>
    ///         <ode>
    ///           <mu>1</mu>
    ///           <mu2>1</mu2>
    ///         </ode>
    ///       </friction>
    ///     </surface>
    ///   </collision>
    /// </gazebo>
    /// where all the contents of `<collision>` element is copied into the
    /// resulting collision sdf.
    public: std::vector<std::shared_ptr<TiXmlElement> > collision_blobs;

    // body, default off
    public: bool setStaticFlag;
    public: bool gravity;
    public: bool isDampingFactor;
    public: double dampingFactor;
    public: bool isMaxContacts;
    public: int maxContacts;
    public: bool isMaxVel;
    public: double maxVel;
    public: bool isMinDepth;
    public: double minDepth;
    public: bool isSelfCollide;
    public: bool selfCollide;

    // geom, contact dynamics
    public: bool isMu1, isMu2, isKp, isKd;
    public: double mu1, mu2, kp, kd;
    public: std::string fdir1;
    public: bool isLaserRetro;
    public: double laserRetro;

    // joint, joint limit dynamics
    public: bool isStopCfm, isStopErp, isFudgeFactor;
    public: double stopCfm, stopErp, fudgeFactor;
    public: bool isSpringReference, isSpringStiffness;
    public: double springReference, springStiffness;
    public: bool isProvideFeedback;
    public: bool provideFeedback;
    public: bool isImplicitSpringDamper;
    public: bool implicitSpringDamper;

    // blobs into body or robot
    public: std::vector<std::shared_ptr<TiXmlElement> > blobs;

    friend class SDFORMAT_VISIBLE URDF2SDF;
  };
}
#endif