joint.h
Go to the documentation of this file.
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  *
36  */
37 #ifndef JOINT_H
38 #define JOINT_H
39 
40 #include <tinyxml.h>
41 #include <urdf_model/joint.h>
42 
43 
44 namespace pr2_mechanism_model {
45 
46 class JointState;
47 
49 {
50  public:
53  violated_limits_(false), initialized_(false){}
54 
55  void update(JointState* s);
56  void reset();
57 
58  double odometer_;
63 
64  private:
66  double old_position_;
67 };
68 
69 
70 
72 {
73 public:
75  void enforceLimits();
76 
78  void getLimits(double &effort_low, double &effort_high);
79 
81 #if URDFDOM_1_0_0_API
82  urdf::JointConstSharedPtr joint_;
83 #else
85 #endif
86 
88  double position_;
89 
91  double velocity_;
92 
95 
96  // joint statistics
98 
101 
104 
107 
109  JointState() : position_(0.0), velocity_(0.0), measured_effort_(0.0),
110  commanded_effort_(0.0), calibrated_(false), reference_position_(0.0){}
111 };
112 
113 enum
114 {
122 };
123 
124 
125 }
126 
127 #endif /* JOINT_H */
XmlRpcServer s
double velocity_
The joint velocity in randians/sec or meters/sec (read-only variable)
Definition: joint.h:91
boost::shared_ptr< const urdf::Joint > joint_
A pointer to the corresponding urdf::Joint from the urdf::Model.
Definition: joint.h:84
void update(JointState *s)
Definition: joint.cpp:46
bool calibrated_
Bool to indicate if the joint has been calibrated or not.
Definition: joint.h:103
double position_
The joint position in radians or meters (read-only variable)
Definition: joint.h:88
JointState()
Constructor.
Definition: joint.h:109
double commanded_effort_
The effort the joint should apply in Nm or N (write-to variable)
Definition: joint.h:100
double measured_effort_
The measured joint effort in Nm or N (read-only variable)
Definition: joint.h:94
double reference_position_
The position of the optical flag that was used to calibrate this joint.
Definition: joint.h:106
JointStatistics joint_statistics_
Definition: joint.h:97


pr2_mechanism_model
Author(s): Eric Berger berger@willowgarage.com, Stuart Glaser, Wim Meeussen
autogenerated on Tue Mar 7 2023 03:54:53