Klamp't  0.8.1
urdf_joint.h
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Willow Garage nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 /* Author: Wim Meeussen */
36 
37 #ifndef URDF_INTERFACE_JOINT_H
38 #define URDF_INTERFACE_JOINT_H
39 
40 #include <string>
41 #include <vector>
42 #include <memory>
43 
44 #include "urdf_pose.h"
45 
46 
47 namespace urdf{
48 
49 class Link;
50 
55 {
56 public:
57  JointDynamics() { this->clear(); };
58  double damping;
59  double friction;
60 
61  void clear()
62  {
63  damping = 0;
64  friction = 0;
65  };
66 };
67 
69 {
70 public:
71  JointLimits() { this->clear(); };
72  double lower;
73  double upper;
74  double effort;
75  double velocity;
76 
77  void clear()
78  {
79  lower = 0;
80  upper = 0;
81  effort = 0;
82  velocity = 0;
83  };
84 };
85 
88 {
89 public:
91  JointSafety() { this->clear(); };
92 
124  double soft_upper_limit;
125  double soft_lower_limit;
126  double k_position;
127  double k_velocity;
128 
129  void clear()
130  {
131  soft_upper_limit = 0;
132  soft_lower_limit = 0;
133  k_position = 0;
134  k_velocity = 0;
135  };
136 };
137 
138 
140 {
141 public:
142  JointCalibration() { this->clear(); };
143  double reference_position;
144  std::shared_ptr<double> rising, falling;
145 
146  void clear()
147  {
148  reference_position = 0;
149  };
150 };
151 
153 {
154 public:
155  JointMimic() { this->clear(); };
156  double offset;
157  double multiplier;
158  std::string joint_name;
159 
160  void clear()
161  {
162  offset = 0.0;
163  multiplier = 0.0;
164  joint_name.clear();
165  };
166 };
167 
168 
169 class Joint
170 {
171 public:
172 
173  Joint() { this->clear(); };
174 
175  std::string name;
176  enum
177  {
178  UNKNOWN, REVOLUTE, CONTINUOUS, PRISMATIC, FLOATING, PLANAR, FIXED
179  } type;
180 
190 
193  std::string child_link_name;
194 
197  std::string parent_link_name;
200 
202  std::shared_ptr<JointDynamics> dynamics;
203 
205  std::shared_ptr<JointLimits> limits;
206 
208  std::shared_ptr<JointSafety> safety;
209 
211  std::shared_ptr<JointCalibration> calibration;
212 
214  std::shared_ptr<JointMimic> mimic;
215 
216  void clear()
217  {
218  this->axis.clear();
219  this->child_link_name.clear();
220  this->parent_link_name.clear();
221  this->parent_to_joint_origin_transform.clear();
222  this->dynamics.reset();
223  this->limits.reset();
224  this->safety.reset();
225  this->calibration.reset();
226  this->type = UNKNOWN;
227  };
228 };
229 
230 }
231 
232 #endif
Parameters for Joint Safety Controllers.
Definition: urdf_joint.h:87
Definition: urdf_joint.h:139
std::shared_ptr< JointCalibration > calibration
Unsupported Hidden Feature.
Definition: urdf_joint.h:211
std::string parent_link_name
Definition: urdf_joint.h:197
Definition: urdf_joint.h:68
Definition: urdf_joint.h:54
Vector3 axis
type_ meaning of axis_ UNKNOWN unknown type REVOLUTE rotation axis PRISMATIC translation axis FLOATIN...
Definition: urdf_joint.h:189
Definition: urdf_color.h:46
std::shared_ptr< JointSafety > safety
Unsupported Hidden Feature.
Definition: urdf_joint.h:208
std::shared_ptr< JointDynamics > dynamics
Joint Dynamics.
Definition: urdf_joint.h:202
std::string child_link_name
Definition: urdf_joint.h:193
Definition: urdf_pose.h:239
Definition: urdf_pose.h:54
std::shared_ptr< JointMimic > mimic
Option to Mimic another Joint.
Definition: urdf_joint.h:214
Pose parent_to_joint_origin_transform
transform from Parent Link frame to Joint frame
Definition: urdf_joint.h:199
std::shared_ptr< JointLimits > limits
Joint Limits.
Definition: urdf_joint.h:205
double soft_upper_limit
Definition: urdf_joint.h:91
Definition: urdf_joint.h:152
Definition: urdf_joint.h:169