##

DARTLink.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_PHYSICS_DART_DARTLINK_HH_
#define GAZEBO_PHYSICS_DART_DARTLINK_HH_
#include <vector>
#include "gazebo/physics/Link.hh"
#include "gazebo/physics/dart/dart_inc.h"
#include "gazebo/physics/dart/DARTTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class DARTLinkPrivate;
class GZ_PHYSICS_VISIBLE DARTLink : public Link
{
public: explicit DARTLink(EntityPtr _parent);
public: virtual ~DARTLink();
// Documentation inherited
public: virtual void Load(sdf::ElementPtr _ptr);
// Documentation inherited.
public: virtual void Init();
// Documentation inherited.
public: virtual void Fini();
// Documentation inherited
public: virtual void OnPoseChange();
// Documentation inherited
public: virtual void SetEnabled(bool _enable) const;
// Documentation inherited
public: virtual bool GetEnabled() const;
// Documentation inherited
public: virtual void SetLinearVel(const ignition::math::Vector3d &_vel);
// Documentation inherited
public: virtual void SetAngularVel(const ignition::math::Vector3d &_vel);
// Documentation inherited
public: virtual void SetForce(const ignition::math::Vector3d &_force);
// Documentation inherited
public: virtual void SetTorque(const ignition::math::Vector3d &_torque);
// Documentation inherited
public: virtual void AddForce(const ignition::math::Vector3d &_force);
// Documentation inherited
public: virtual void AddRelativeForce(
const ignition::math::Vector3d &_force);
// Documentation inherited
public: virtual void AddForceAtWorldPosition(
const ignition::math::Vector3d &_force,
const ignition::math::Vector3d &_pos);
// Documentation inherited
public: virtual void AddForceAtRelativePosition(
const ignition::math::Vector3d &_force,
const ignition::math::Vector3d &_relpos);
// Documentation inherited
public: virtual void AddLinkForce(
const ignition::math::Vector3d &_force,
const ignition::math::Vector3d &_offset =
ignition::math::Vector3d::Zero);
// Documentation inherited
public: virtual void AddTorque(const ignition::math::Vector3d &_torque);
// Documentation inherited
public: virtual void AddRelativeTorque(
const ignition::math::Vector3d &_torque);
// Documentation inherited
public: virtual ignition::math::Vector3d WorldLinearVel(
const ignition::math::Vector3d &_offset =
ignition::math::Vector3d::Zero) const;
// Documentation inherited
public: virtual ignition::math::Vector3d WorldLinearVel(
const ignition::math::Vector3d &_offset,
const ignition::math::Quaterniond &_q) const;
// Documentation inherited
public: virtual ignition::math::Vector3d WorldCoGLinearVel() const;
// Documentation inherited
public: virtual ignition::math::Vector3d WorldAngularVel() const;
// Documentation inherited
public: virtual ignition::math::Vector3d WorldForce() const;
// Documentation inherited
public: virtual ignition::math::Vector3d WorldTorque() const;
// Documentation inherited
public: virtual void SetGravityMode(bool _mode);
// Documentation inherited
public: virtual bool GetGravityMode() const;
// Documentation inherited
public: virtual void SetSelfCollide(bool _collide);
// Documentation inherited
public: virtual void SetLinearDamping(double _damping);
// Documentation inherited
public: virtual void SetAngularDamping(double _damping);
// Documentation inherited
public: virtual void SetKinematic(const bool &_state);
// Documentation inherited
public: virtual bool GetKinematic() const;
// Documentation inherited
public: virtual void SetAutoDisable(bool _disable);
// Documentation inherited
public: virtual void SetLinkStatic(bool _static);
// Documentation inherited.
public: virtual void UpdateMass();
public: void updateDirtyPoseFromDARTTransformation();
public: DARTPhysicsPtr GetDARTPhysics(void) const;
public: dart::simulation::WorldPtr DARTWorld(void) const;
public: DARTModelPtr GetDARTModel() const;
public: DARTBodyNodePropPtr DARTProperties() const;
public: void SetDARTBodyNode(dart::dynamics::BodyNode *_dtBodyNode);
public: void AddSlaveBodyNode(dart::dynamics::BodyNode *_dtBodyNode);
public: dart::dynamics::BodyNode *DARTBodyNode() const;
public: void SetDARTParentJoint(DARTJointPtr _dartParentJoint);
public: void AddDARTChildJoint(DARTJointPtr _dartChildJoint);
public: bool IsSoftBody() const;
private: DARTLinkPrivate *dataPtr;
};
}
}
#endif
gazebo::physics::DARTLink::WorldAngularVel
virtual ignition::math::Vector3d WorldAngularVel() const
Get the angular velocity of the entity in the world frame.
gazebo::physics::DARTLink::SetDARTBodyNode
void SetDARTBodyNode(dart::dynamics::BodyNode *_dtBodyNode)
Set pointer to DART BodyNode associated with this link.
DARTTypes.hh
DART wrapper forward declarations and typedefs.
gazebo::physics::DARTLink::SetGravityMode
virtual void SetGravityMode(bool _mode)
Set whether gravity affects this body.
gazebo::physics::DARTJointPtr
boost::shared_ptr< DARTJoint > DARTJointPtr
Definition: DARTTypes.hh:48
gazebo::physics::Link::WorldLinearVel
virtual ignition::math::Vector3d WorldLinearVel() const
Get the linear velocity of the origin of the link frame, expressed in the world frame.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::DARTLink::SetAutoDisable
virtual void SetAutoDisable(bool _disable)
Allow the link to auto disable.
gazebo::physics::DARTLink::DARTLink
DARTLink(EntityPtr _parent)
Constructor.
gazebo::physics::DARTLink::GetDARTPhysics
DARTPhysicsPtr GetDARTPhysics(void) const
Get pointer to DART Physics engine associated with this link.
gazebo::physics::DARTLink::SetForce
virtual void SetForce(const ignition::math::Vector3d &_force)
Set the force applied to the body.
gazebo::physics::DARTLink::SetDARTParentJoint
void SetDARTParentJoint(DARTJointPtr _dartParentJoint)
Set parent joint of this link.
gazebo::physics::DARTLink::SetKinematic
virtual void SetKinematic(const bool &_state)
\TODO Implement this function.
Link.hh
system.hh
gazebo::physics::DARTLink::UpdateMass
virtual void UpdateMass()
Update the mass matrix.
gazebo::physics::DARTLink::SetAngularDamping
virtual void SetAngularDamping(double _damping)
Set the angular damping factor.
gazebo::physics::DARTLink::Load
virtual void Load(sdf::ElementPtr _ptr)
Load the body based on an SDF element.
gazebo::physics::DARTLink::DARTProperties
DARTBodyNodePropPtr DARTProperties() const
Get DART BodyNode properties.
gazebo::physics::DARTLink::SetTorque
virtual void SetTorque(const ignition::math::Vector3d &_torque)
Set the torque applied to the body.
gazebo::physics::DARTLink::AddRelativeTorque
virtual void AddRelativeTorque(const ignition::math::Vector3d &_torque)
Add a torque to the body, components are relative to the body's own frame of reference.
gazebo::physics::DARTPhysicsPtr
boost::shared_ptr< DARTPhysics > DARTPhysicsPtr
Definition: DARTTypes.hh:43
gazebo::physics::DARTLink::WorldTorque
virtual ignition::math::Vector3d WorldTorque() const
Get the torque applied to the body about the center of mass in world frame coordinates.
gazebo::physics::Link
Link class defines a rigid body entity, containing information on inertia, visual and collision prope...
Definition: Link.hh:52
gazebo::physics::DARTLink::WorldCoGLinearVel
virtual ignition::math::Vector3d WorldCoGLinearVel() const
Get the linear velocity at the body's center of gravity in the world frame.
gazebo::physics::DARTLink::SetLinearDamping
virtual void SetLinearDamping(double _damping)
Set the linear damping factor.
gazebo::physics::DARTLink::DARTBodyNode
dart::dynamics::BodyNode * DARTBodyNode() const
Get pointer to DART BodyNode associated with this link.
gazebo::physics::DARTLink::IsSoftBody
bool IsSoftBody() const
Get whether this link is soft body.
gazebo::physics::DARTLink::DARTWorld
dart::simulation::WorldPtr DARTWorld(void) const
Get pointer to DART World associated with this link.
gazebo::physics::DARTLink::AddSlaveBodyNode
void AddSlaveBodyNode(dart::dynamics::BodyNode *_dtBodyNode)
Add pointer to a BodyNode representing a fragment of this link.
gazebo::physics::DARTLink::updateDirtyPoseFromDARTTransformation
void updateDirtyPoseFromDARTTransformation()
Store DART Transformation to Entity::dirtyPose and add this link to World::dirtyPoses so that World::...
gazebo::physics::DARTLink::AddRelativeForce
virtual void AddRelativeForce(const ignition::math::Vector3d &_force)
Add a force to the body, components are relative to the body's own frame of reference.
gazebo::physics::DARTLink::AddForceAtWorldPosition
virtual void AddForceAtWorldPosition(const ignition::math::Vector3d &_force, const ignition::math::Vector3d &_pos)
Add a force to the body using a global position.
gazebo::physics::DARTLink::AddForceAtRelativePosition
virtual void AddForceAtRelativePosition(const ignition::math::Vector3d &_force, const ignition::math::Vector3d &_relpos)
Add a force (in world frame coordinates) to the body at a position relative to the center of mass whi...
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::DARTLink::Init
virtual void Init()
Initialize the body.
gazebo::physics::DARTModelPtr
boost::shared_ptr< DARTModel > DARTModelPtr
Definition: DARTTypes.hh:46
gazebo::physics::DARTLink::GetGravityMode
virtual bool GetGravityMode() const
Get the gravity mode.
gazebo::physics::EntityPtr
boost::shared_ptr< Entity > EntityPtr
Definition: PhysicsTypes.hh:85
gazebo::physics::DARTLink::OnPoseChange
virtual void OnPoseChange()
This function is called when the entity's (or one of its parents) pose of the parent has changed.
gazebo::physics::DARTLink::SetLinkStatic
virtual void SetLinkStatic(bool _static)
Freeze link to ground (inertial frame).
gazebo::physics::DARTLink::AddForce
virtual void AddForce(const ignition::math::Vector3d &_force)
Add a force to the body.
dart_inc.h
gazebo::physics::DARTLink::AddTorque
virtual void AddTorque(const ignition::math::Vector3d &_torque)
Add a torque to the body.
gazebo::physics::DARTLink::AddDARTChildJoint
void AddDARTChildJoint(DARTJointPtr _dartChildJoint)
Set child joint of this link.
gazebo::physics::DARTLink::GetDARTModel
DARTModelPtr GetDARTModel() const
Get pointer to DART Model associated with this link.
gazebo::physics::DARTLink::Fini
virtual void Fini()
Finalize the entity.
gazebo::physics::WorldPtr
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
gazebo::physics::DARTLink::GetEnabled
virtual bool GetEnabled() const
Get whether this body is enabled in the physics engine.
gazebo::physics::DARTLink::SetSelfCollide
virtual void SetSelfCollide(bool _collide)
Set whether this body will collide with others in the model.
gazebo::physics::DARTLink::AddLinkForce
virtual void AddLinkForce(const ignition::math::Vector3d &_force, const ignition::math::Vector3d &_offset=ignition::math::Vector3d::Zero)
Add a force expressed in the link frame.
gazebo::physics::DARTLink::WorldForce
virtual ignition::math::Vector3d WorldForce() const
Get the force applied to the body in the world frame.
gazebo::physics::DARTLink::~DARTLink
virtual ~DARTLink()
Destructor.
gazebo::physics::DARTLink::SetAngularVel
virtual void SetAngularVel(const ignition::math::Vector3d &_vel)
Set the angular velocity of the body.
gazebo::physics::DARTBodyNodePropPtr
std::shared_ptr< dart::dynamics::BodyNode::Properties > DARTBodyNodePropPtr
Definition: DARTTypes.hh:54
gazebo::physics::DARTLink
DART Link class.
Definition: DARTLink.hh:39
gazebo::physics::DARTLink::SetLinearVel
virtual void SetLinearVel(const ignition::math::Vector3d &_vel)
Set the linear velocity of the body.
gazebo::physics::DARTLink::SetEnabled
virtual void SetEnabled(bool _enable) const
Set whether this body is enabled.
gazebo::physics::DARTLink::GetKinematic
virtual bool GetKinematic() const
\TODO Implement this function.