##

BulletScrewJoint.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 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.
*
*/
/* Desc: A screw or primastic joint
* Author: Nate Koenig
* Date: 24 May 2009
*/
#ifndef _BULLETSCREWJOINT_HH_
#define _BULLETSCREWJOINT_HH_
#include <string>
#include "gazebo/physics/bullet/BulletJoint.hh"
#include "gazebo/physics/ScrewJoint.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class btScrewConstraint;
class GZ_PHYSICS_VISIBLE BulletScrewJoint : public ScrewJoint<BulletJoint>
{
public: BulletScrewJoint(btDynamicsWorld *_world, BasePtr _parent);
public: virtual ~BulletScrewJoint();
public: virtual void Load(sdf::ElementPtr _sdf);
// Documentation inherited
public: virtual ignition::math::Vector3d Anchor(
const unsigned int _index) const;
// Documentation inherited
public: virtual void SetAnchor(const unsigned int _index,
const ignition::math::Vector3d &_anchor);
// Documentation inherited.
public: virtual void Init();
public: void SetAxis(const unsigned int _index,
const ignition::math::Vector3d &_axis);
// Documentation inherited
public: virtual void SetThreadPitch(unsigned int _index,
double _threadPitch);
// Documentation inherited
public: virtual void SetThreadPitch(double _threadPitch);
// Documentation inherited
public: virtual double GetThreadPitch(unsigned int _index);
// Documentation inherited
public: virtual double GetThreadPitch();
// Documentation inherited.
public: virtual void SetUpperLimit(const unsigned int _index,
const double _limit);
// Documentation inherited.
public: virtual void SetLowerLimit(const unsigned int _index,
const double _limit);
public: virtual double GetVelocity(unsigned int _index) const;
public: virtual void SetVelocity(unsigned int _index, double _vel);
public: virtual ignition::math::Vector3d GlobalAxis(
const unsigned int _index) const;
// Documentation inherited.
public: virtual double GetParam(const std::string &_key,
unsigned int _index);
// Documentation inherited.
protected: virtual double PositionImpl(const unsigned int _index) const;
// Documentation inherited.
protected: virtual void SetForceImpl(unsigned int _index, double _force);
private: btScrewConstraint *bulletScrew;
private: ignition::math::Vector3d initialWorldAxis;
};
}
}
#endif
gazebo::physics::BulletScrewJoint::SetLowerLimit
virtual void SetLowerLimit(const unsigned int _index, const double _limit)
Set the joint's lower limit.
gazebo::physics::BulletScrewJoint
A screw joint.
Definition: BulletScrewJoint.hh:42
gazebo::physics::ScrewJoint
A screw joint, which has both prismatic and rotational DOFs.
Definition: ScrewJoint.hh:35
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::BulletScrewJoint::GetVelocity
virtual double GetVelocity(unsigned int _index) const
Get the rate of change.
gazebo::physics::BulletScrewJoint::SetUpperLimit
virtual void SetUpperLimit(const unsigned int _index, const double _limit)
Set the joint's upper limit.
gazebo::physics::BulletScrewJoint::SetAxis
void SetAxis(const unsigned int _index, const ignition::math::Vector3d &_axis)
Set the axis of motion.
gazebo::physics::BulletScrewJoint::GetThreadPitch
virtual double GetThreadPitch()
Get screw joint thread pitch.
system.hh
gazebo::physics::BulletScrewJoint::Load
virtual void Load(sdf::ElementPtr _sdf)
Load the BulletScrewJoint.
gazebo::physics::BulletScrewJoint::GlobalAxis
virtual ignition::math::Vector3d GlobalAxis(const unsigned int _index) const
Get the axis of rotation.
gazebo::physics::BulletScrewJoint::SetThreadPitch
virtual void SetThreadPitch(unsigned int _index, double _threadPitch)
gazebo::physics::BulletScrewJoint::Anchor
virtual ignition::math::Vector3d Anchor(const unsigned int _index) const
Get the anchor point.
BulletJoint.hh
gazebo::physics::BulletScrewJoint::SetForceImpl
virtual void SetForceImpl(unsigned int _index, double _force)
Set the force applied to this physics::Joint.
gazebo::physics::BasePtr
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
gazebo::physics::BulletScrewJoint::BulletScrewJoint
BulletScrewJoint(btDynamicsWorld *_world, BasePtr _parent)
Constructor.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::BulletScrewJoint::~BulletScrewJoint
virtual ~BulletScrewJoint()
Destructor.
gazebo::physics::BulletScrewJoint::SetVelocity
virtual void SetVelocity(unsigned int _index, double _vel)
Set the velocity of an axis(index).
ScrewJoint.hh
gazebo::physics::BulletScrewJoint::GetParam
virtual double GetParam(const std::string &_key, unsigned int _index)
Get a non-generic parameter for the joint.
gazebo::physics::BulletScrewJoint::SetAnchor
virtual void SetAnchor(const unsigned int _index, const ignition::math::Vector3d &_anchor)
Set the anchor point.
gazebo::physics::BulletScrewJoint::PositionImpl
virtual double PositionImpl(const unsigned int _index) const
Helper function to get the position of an axis.
gazebo::physics::BulletScrewJoint::Init
virtual void Init()
Initialize joint.