##

DARTJoint.hh
Go to the documentation of this file.
/*
* Copyright (C) 2014 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 _GAZEBO_DARTJOINT_HH_
#define _GAZEBO_DARTJOINT_HH_
#include <boost/any.hpp>
#include <string>
#include "gazebo/common/Exception.hh"
#include "gazebo/physics/Joint.hh"
#include "gazebo/physics/dart/dart_inc.h"
#include "gazebo/physics/dart/DARTPhysics.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class DARTJointPrivate;
class GZ_PHYSICS_VISIBLE DARTJoint : public Joint
{
public: explicit DARTJoint(BasePtr _parent);
public: virtual ~DARTJoint();
// Documentation inherited.
public: virtual void Load(sdf::ElementPtr _sdf) override;
public: virtual void Init() override;
// Documentation inherited.
public: virtual void Reset() override;
// Documentation inherited.
public: virtual LinkPtr GetJointLink(unsigned int _index) const override;
// Documentation inherited.
public: virtual bool AreConnected(LinkPtr _one, LinkPtr _two) const
override;
// Documentation inherited.
public: virtual void Attach(LinkPtr _parent, LinkPtr _child) override;
// Documentation inherited.
public: virtual void Detach() override;
// Documentation inherited
public: virtual void SetDamping(unsigned int _index, double _damping)
override;
// Documentation inherited.
public: virtual void SetStiffnessDamping(unsigned int _index,
double _stiffness, double _damping, double _reference = 0) override;
// Documentation inherited.
public: virtual void SetStiffness(unsigned int _index,
const double _stiffness) override;
public: virtual void SetAnchor(const unsigned int /*_index*/,
const ignition::math::Vector3d &/*_anchor*/) override;
public: virtual ignition::math::Vector3d Anchor(
const unsigned int /*_index*/) const override final;
// Documentation inherited
public: virtual void SetVelocity(unsigned int _index, double _vel)
override final;
// Documentation inherited
public: virtual double GetVelocity(unsigned int _index)
const override;
// Documentation inherited.
public: virtual void SetForce(unsigned int _index, double _force)
override;
// Documentation inherited.
public: virtual double GetForce(unsigned int _index) override;
// Documentation inherited.
public: virtual JointWrench GetForceTorque(unsigned int _index) override;
// Documentation inherited.
public: virtual bool SetPosition(
const unsigned int _index,
const double _position,
const bool _preserveWorldVelocity = false)
override final;
// Documentation inherited.
public: virtual ignition::math::Vector3d LinkForce(
const unsigned int _index) const override;
// Documentation inherited.
public: virtual ignition::math::Vector3d LinkTorque(
const unsigned int _index) const override;
// Documentation inherited.
public: virtual bool SetParam(const std::string &_key,
unsigned int _index,
const boost::any &_value) override;
// Documentation inherited.
public: virtual double GetParam(const std::string &_key,
unsigned int _index) override;
// Documentation inherited.
public: virtual double LowerLimit(const unsigned int _index) const
override;
// Documentation inherited.
public: virtual double UpperLimit(const unsigned int _index) const
override;
// Documentation inherited.
public: virtual void SetLowerLimit(const unsigned int _index,
const double _limit) override;
// Documentation inherited.
public: virtual void SetUpperLimit(const unsigned int _index,
const double _limit) override;
// Documentation inherited.
public: virtual void CacheForceTorque() override;
// Documentation inherited.
protected: virtual double PositionImpl(const unsigned int _index = 0)
const override;
// Documentation inherited.
public: virtual void ApplyDamping();
protected: void SetForceImpl(unsigned int _index, double _force);
private: void SaveForce(unsigned int _index, double _force);
public: DARTModelPtr GetDARTModel() const;
public: DARTJointPropPtr DARTProperties() const;
public: void SetDARTJoint(dart::dynamics::Joint *_dtJoint);
public: dart::dynamics::Joint *GetDARTJoint();
protected: DARTJointPrivate *dataPtr;
};
}
}
#endif
gazebo::physics::DARTJoint::SetDARTJoint
void SetDARTJoint(dart::dynamics::Joint *_dtJoint)
Set DART joint pointer.
gazebo::physics::DARTJoint::GetDARTModel
DARTModelPtr GetDARTModel() const
Get DART model pointer.
gazebo::physics::DARTJoint::~DARTJoint
virtual ~DARTJoint()
Destructor.
gazebo::physics::DARTJoint::SetForceImpl
void SetForceImpl(unsigned int _index, double _force)
Set the force applied to this physics::Joint.
gazebo::physics::DARTJoint::CacheForceTorque
virtual void CacheForceTorque() override
Cache Joint Force Torque Values if necessary for physics engine.
gazebo::physics::DARTJoint::Attach
virtual void Attach(LinkPtr _parent, LinkPtr _child) override
Attach the two bodies with this joint.
gazebo::physics::DARTJoint::SetVelocity
virtual void SetVelocity(unsigned int _index, double _vel) override final
Set the velocity of an axis(index).
gazebo::physics::DARTJoint::SetStiffness
virtual void SetStiffness(unsigned int _index, const double _stiffness) override
Set the joint spring stiffness.
gazebo::physics::DARTJoint::Anchor
virtual ignition::math::Vector3d Anchor(const unsigned int) const override final
Get the anchor point.
gazebo::physics::DARTJoint::SetForce
virtual void SetForce(unsigned int _index, double _force) override
Set the force applied to this physics::Joint.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
DARTPhysics.hh
gazebo::physics::DARTJoint::UpperLimit
virtual double UpperLimit(const unsigned int _index) const override
Get the joint's upper limit.
Exception.hh
gazebo::physics::DARTJoint::Load
virtual void Load(sdf::ElementPtr _sdf) override
Load physics::Joint from a SDF sdf::Element.
gazebo::physics::DARTJoint::AreConnected
virtual bool AreConnected(LinkPtr _one, LinkPtr _two) const override
Determines of the two bodies are connected by a joint.
gazebo::physics::DARTJoint::Init
virtual void Init() override
Initialize a joint.
system.hh
gazebo::physics::DARTJoint::LowerLimit
virtual double LowerLimit(const unsigned int _index) const override
Get the joint's lower limit.
gazebo::physics::DARTJoint::SetUpperLimit
virtual void SetUpperLimit(const unsigned int _index, const double _limit) override
Set the joint's upper limit.
gazebo::physics::DARTJoint::SetAnchor
virtual void SetAnchor(const unsigned int, const ignition::math::Vector3d &) override
Set the anchor point.
gazebo::physics::DARTJoint::ApplyDamping
virtual void ApplyDamping()
gazebo::physics::DARTJoint::GetJointLink
virtual LinkPtr GetJointLink(unsigned int _index) const override
Get the link to which the joint is attached according the _index.
gazebo::physics::DARTJoint::LinkForce
virtual ignition::math::Vector3d LinkForce(const unsigned int _index) const override
Get the forces applied to the center of mass of a physics::Link due to the existence of this Joint.
gazebo::physics::DARTJoint::GetParam
virtual double GetParam(const std::string &_key, unsigned int _index) override
Get a non-generic parameter for the joint.
gazebo::physics::DARTJoint::DARTProperties
DARTJointPropPtr DARTProperties() const
Get DART Joint properties.
gazebo::physics::Joint
Base class for all joints.
Definition: Joint.hh:50
gazebo::physics::DARTJoint::PositionImpl
virtual double PositionImpl(const unsigned int _index=0) const override
Helper function to get the position of an axis.
gazebo::physics::DARTJoint::SetParam
virtual bool SetParam(const std::string &_key, unsigned int _index, const boost::any &_value) override
Set a non-generic parameter for the joint.
gazebo::physics::DARTJoint::GetDARTJoint
dart::dynamics::Joint * GetDARTJoint()
Get DART joint pointer.
Joint.hh
gazebo::physics::DARTJoint::SetPosition
virtual bool SetPosition(const unsigned int _index, const double _position, const bool _preserveWorldVelocity=false) override final
The child links of this joint are updated based on desired position.
gazebo::physics::DARTJoint::dataPtr
DARTJointPrivate * dataPtr
Definition: DARTJoint.hh:191
gazebo::physics::DARTJoint::GetForceTorque
virtual JointWrench GetForceTorque(unsigned int _index) override
get internal force and torque values at a joint.
gazebo::physics::BasePtr
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
gazebo::physics::DARTJoint::SetStiffnessDamping
virtual void SetStiffnessDamping(unsigned int _index, double _stiffness, double _damping, double _reference=0) override
Set the joint spring stiffness.
gazebo::physics::DARTJoint::GetForce
virtual double GetForce(unsigned int _index) override
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::DARTModelPtr
boost::shared_ptr< DARTModel > DARTModelPtr
Definition: DARTTypes.hh:46
gazebo::physics::DARTJoint::Reset
virtual void Reset() override
Reset the joint.
gazebo::physics::LinkPtr
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
gazebo::physics::DARTJoint::SetLowerLimit
virtual void SetLowerLimit(const unsigned int _index, const double _limit) override
Set the joint's lower limit.
gazebo::physics::DARTJoint::GetVelocity
virtual double GetVelocity(unsigned int _index) const override
Get the rotation rate of an axis(index)
gazebo::physics::DARTJoint::Detach
virtual void Detach() override
Detach this joint from all links.
gazebo::physics::DARTJointPropPtr
std::shared_ptr< dart::dynamics::Joint::Properties > DARTJointPropPtr
Definition: DARTTypes.hh:56
gazebo::physics::DARTJoint::SetDamping
virtual void SetDamping(unsigned int _index, double _damping) override
Set the joint damping.
dart_inc.h
gazebo::physics::DARTJoint::DARTJoint
DARTJoint(BasePtr _parent)
Constructor.
gazebo::physics::DARTJoint::LinkTorque
virtual ignition::math::Vector3d LinkTorque(const unsigned int _index) const override
Get the torque applied to the center of mass of a physics::Link due to the existence of this Joint.
gazebo::physics::JointWrench
Wrench information from a joint. These are forces and torques on parent and child Links,...
Definition: JointWrench.hh:40
gazebo::physics::DARTJoint
DART joint interface.
Definition: DARTJoint.hh:41