20 #include <boost/any.hpp> 43 DAMPING_ACTIVE = 0x00000001,
45 JOINT_LIMIT = 0x00000002
56 public:
virtual void Load(sdf::ElementPtr _sdf)
override;
59 public:
virtual void Fini()
override;
62 public:
virtual void Reset()
override;
65 public:
virtual LinkPtr GetJointLink(
unsigned int _index)
const override;
68 public:
virtual bool AreConnected(
LinkPtr _one,
LinkPtr _two)
const 72 public:
virtual void CacheForceTorque()
override;
80 public:
virtual double GetParam(
unsigned int _parameter)
const;
88 public:
virtual void SetParam(
unsigned int _parameter,
double _value);
91 public:
virtual void SetDamping(
unsigned int _index,
double _damping)
95 public:
virtual bool SetPosition(
96 const unsigned int _index,
97 const double _position,
98 const bool _preserveWorldVelocity =
false)
102 public:
virtual void SetStiffness(
unsigned int _index,
103 const double _stiffness)
override;
106 public:
virtual void SetStiffnessDamping(
unsigned int _index,
107 double _stiffness,
double _damping,
double _reference = 0)
override;
110 public:
virtual void Attach(
LinkPtr _parent,
LinkPtr _child)
override;
113 public:
virtual void Detach()
override;
117 public:
void SetERP(
double _erp);
121 public:
double GetERP();
125 public:
void SetCFM(
double _cfm);
129 public:
double GetCFM();
133 public: dJointFeedback *GetFeedback();
137 public:
bool UsesImplicitSpringDamper();
141 public:
void UseImplicitSpringDamper(
const bool _implicit);
145 public:
void ApplyImplicitStiffnessDamping();
148 public:
void ApplyExplicitStiffnessDamping();
154 return this->stopCFM;
161 return this->stopERP;
173 private:
double ApplyAdaptiveDamping(
unsigned int _index,
174 const double _damping);
182 private:
void KpKdToCFMERP(
const double _dt,
183 const double _kp,
const double _kd,
184 double &_cfm,
double &_erp);
192 private:
void CFMERPToKpKd(
const double _dt,
193 const double _cfm,
const double _erp,
194 double &_kp,
double &_kd);
207 private:
bool stiffnessDampingInitialized;
210 private:
bool useImplicitSpringDamper;
213 public:
virtual void SetUpperLimit(
const unsigned int _index,
214 const double _limit)
override;
217 public:
virtual void SetLowerLimit(
const unsigned int _index,
218 const double _limit)
override;
221 public:
virtual ignition::math::Vector3d LinkForce(
222 const unsigned int _index)
const override;
225 public:
virtual ignition::math::Vector3d LinkTorque(
226 const unsigned int _index)
const override;
229 public:
virtual void SetAxis(
const unsigned int _index,
230 const ignition::math::Vector3d &_axis)
override;
233 public:
virtual bool SetParam(
const std::string &_key,
235 const boost::any &_value)
override;
238 public:
virtual double GetParam(
const std::string &_key,
239 unsigned int _index)
override;
242 public:
virtual void SetProvideFeedback(
bool _enable)
override;
245 public:
virtual JointWrench GetForceTorque(
unsigned int _index)
override;
248 public:
virtual void SetForce(
unsigned int _index,
double _force)
252 public:
virtual double GetForce(
unsigned int _index)
override;
255 public:
virtual void ApplyStiffnessDamping()
override;
266 protected:
virtual void SetForceImpl(
267 unsigned int _index,
double _force) = 0;
272 private:
void SaveForce(
unsigned int _index,
double _force);
281 private: dJointFeedback *feedback;
284 private:
double stopCFM;
287 private:
double stopERP;
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:110
Forward declarations for the common classes.
Definition: Animation.hh:26
double GetStopERP()
Get access to stopERP.
Definition: ODEJoint.hh:159
dJointID jointId
This is our ODE ID.
Definition: ODEJoint.hh:275
double GetStopCFM()
Get access to stopCFM.
Definition: ODEJoint.hh:152
CFMMode
internal variables used for implicit damping
Definition: ODEJoint.hh:38
#define MAX_JOINT_AXIS
maximum number of axis per joint anticipated.
Definition: Joint.hh:39
Base class for all joints.
Definition: Joint.hh:50
Wrench information from a joint.
Definition: JointWrench.hh:40
ODE joint interface.
Definition: ODEJoint.hh:35
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:78
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:47