Go to the documentation of this file.
22 #ifndef _BULLETJOINT_HH_
23 #define _BULLETJOINT_HH_
25 #include <boost/any.hpp>
50 public:
virtual void Load(sdf::ElementPtr _sdf)
override;
53 public:
virtual void Fini()
override;
56 public:
virtual void Reset()
override;
60 public:
LinkPtr GetJointLink(
unsigned int _index)
const override;
63 public:
bool AreConnected(
LinkPtr _one,
LinkPtr _two)
const override;
66 public:
virtual void Detach()
override;
69 public:
virtual void SetAnchor(
const unsigned int _index,
70 const ignition::math::Vector3d &_anchor)
74 public:
virtual void SetDamping(
unsigned int _index,
double _damping)
78 public:
virtual bool SetPosition(
79 const unsigned int _index,
const double _position,
80 const bool _preserveWorldVelocity =
false)
override;
83 public:
virtual void SetStiffness(
unsigned int _index,
84 const double _stiffness)
override;
87 public:
virtual void SetStiffnessDamping(
unsigned int _index,
88 double _stiffness,
double _damping,
double _reference = 0)
override;
91 public:
virtual ignition::math::Vector3d Anchor(
92 const unsigned int _index)
const override;
96 public:
virtual ignition::math::Vector3d LinkForce(
97 const unsigned int _index)
const override;
101 public:
virtual ignition::math::Vector3d LinkTorque(
102 const unsigned int _index)
const override;
105 public:
virtual bool SetParam(
const std::string &_key,
107 const boost::any &_value)
override;
110 public:
virtual double GetParam(
const std::string &_key,
111 unsigned int _index)
override;
114 public:
virtual void SetProvideFeedback(
bool _enable)
override;
117 public:
virtual void CacheForceTorque()
override;
120 public:
virtual JointWrench GetForceTorque(
unsigned int _index)
override;
123 public:
virtual void SetForce(
unsigned int _index,
double _force)
127 public:
virtual double GetForce(
unsigned int _index)
override;
130 public:
virtual void Init()
override;
133 public:
virtual void ApplyStiffnessDamping()
override;
145 protected:
virtual void SetForceImpl(
unsigned int _index,
150 protected:
void SetupJointFeedback();
155 private:
void SaveForce(
unsigned int _index,
double _force);
164 private: btJointFeedback *feedback;
168 private:
bool stiffnessDampingInitialized;
#define MAX_JOINT_AXIS
maximum number of axis per joint anticipated.
Definition: Joint.hh:39
virtual void SetForce(unsigned int _index, double _force) override
Set the force applied to this physics::Joint.
virtual void Detach() override
Detach this joint from all bodies.
void SetupJointFeedback()
: Setup joint feedback datatructure.
virtual bool SetPosition(const unsigned int _index, const double _position, const bool _preserveWorldVelocity=false) override
The child links of this joint are updated based on desired position.
Forward declarations for the common classes.
Definition: Animation.hh:26
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:47
virtual ignition::math::Vector3d LinkForce(const unsigned int _index) const override
Get the force the joint applies to the first body.
virtual void SetStiffness(unsigned int _index, const double _stiffness) override
Set the joint spring stiffness.
virtual void SetProvideFeedback(bool _enable) override
Set whether the joint should generate feedback.
virtual ~BulletJoint()
Destructor.
virtual double GetParam(const std::string &_key, unsigned int _index) override
Get a non-generic parameter for the joint.
btTypedConstraint * constraint
Pointer to a contraint object in Bullet.
Definition: BulletJoint.hh:158
LinkPtr GetJointLink(unsigned int _index) const override
Get the body to which the joint is attached according the _index.
virtual void CacheForceTorque() override
Cache Joint Force Torque Values if necessary for physics engine.
virtual void Reset() override
Reset the joint.
virtual void Init() override
Initialize a joint.
virtual ignition::math::Vector3d Anchor(const unsigned int _index) const override
Get the anchor point.
virtual bool SetParam(const std::string &_key, unsigned int _index, const boost::any &_value) override
Set a non-generic parameter for the joint.
virtual void SetForceImpl(unsigned int _index, double _force)=0
Set the force applied to this physics::Joint.
Base class for all joints.
Definition: BulletJoint.hh:41
Base class for all joints.
Definition: Joint.hh:50
virtual JointWrench GetForceTorque(unsigned int _index) override
get internal force and torque values at a joint.
bool AreConnected(LinkPtr _one, LinkPtr _two) const override
Determines of the two bodies are connected by a joint.
virtual void Fini() override
Finialize the object.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
virtual ignition::math::Vector3d LinkTorque(const unsigned int _index) const override
Get the torque the joint applies to the first body.
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
virtual void SetStiffnessDamping(unsigned int _index, double _stiffness, double _damping, double _reference=0) override
Set the joint spring stiffness.
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
btDynamicsWorld * bulletWorld
Pointer to Bullet's btDynamicsWorld.
Definition: BulletJoint.hh:161
virtual void Load(sdf::ElementPtr _sdf) override
Load a BulletJoint.
BulletJoint(BasePtr _parent)
Constructor.
Wrench information from a joint. These are forces and torques on parent and child Links,...
Definition: JointWrench.hh:40
virtual double GetForce(unsigned int _index) override
virtual void ApplyStiffnessDamping() override
Callback to apply spring stiffness and viscous damping effects to joint.
virtual void SetDamping(unsigned int _index, double _damping) override
Set the joint damping.
virtual void SetAnchor(const unsigned int _index, const ignition::math::Vector3d &_anchor) override
Set the anchor point.