##

UniversalJoint.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.
*
*/
#ifndef _GAZEBO_UNIVERSALJOINT_HH_
#define _GAZEBO_UNIVERSALJOINT_HH_
#include "gazebo/physics/Joint.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
template<class T>
class GZ_PHYSICS_VISIBLE UniversalJoint : public T
{
public: enum AxisIndex
{
AXIS_PARENT = 0,
AXIS_CHILD = 1
};
public: explicit UniversalJoint(BasePtr _parent) : T(_parent)
{this->AddType(Base::UNIVERSAL_JOINT);}
public: virtual ~UniversalJoint()
{ }
// Documentation inherited.
public: virtual unsigned int DOF() const
{return 2;}
public: virtual void Load(sdf::ElementPtr _sdf)
{
T::Load(_sdf);
/*
this->SetAxis(0,
this->sdf->GetElement("axis")->Get<ignition::math::Vector3d("xyz"));
this->SetAxis(1,
this->sdf->GetElement("axis2")->Get<ignition::math::Vector3d>("xyz"));
*/
}
protected: virtual void Init()
{
T::Init();
}
};
}
}
#endif
gazebo::physics::UniversalJoint::UniversalJoint
UniversalJoint(BasePtr _parent)
Constructor.
Definition: UniversalJoint.hh:47
gazebo::physics::UniversalJoint::Init
virtual void Init()
Initialize joint.
Definition: UniversalJoint.hh:73
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::UniversalJoint::DOF
virtual unsigned int DOF() const
Definition: UniversalJoint.hh:55
gazebo::physics::UniversalJoint::AXIS_PARENT
Definition: UniversalJoint.hh:41
gazebo::physics::UniversalJoint::~UniversalJoint
virtual ~UniversalJoint()
Destuctor.
Definition: UniversalJoint.hh:51
system.hh
gazebo::physics::UniversalJoint< BulletJoint >::AxisIndex
AxisIndex
Map joint axes to corresponding link.
Definition: UniversalJoint.hh:39
gazebo::physics::UniversalJoint::Load
virtual void Load(sdf::ElementPtr _sdf)
Load a UniversalJoint.
Definition: UniversalJoint.hh:60
gazebo::physics::Base::UNIVERSAL_JOINT
UniversalJoint type.
Definition: Base.hh:104
Joint.hh
gazebo::physics::BasePtr
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::UniversalJoint
A universal joint. Axis1 and axis2 are body-fixed, with axis1 attached to parent body and axis2 attac...
Definition: UniversalJoint.hh:35
gazebo::physics::UniversalJoint::AXIS_CHILD
Definition: UniversalJoint.hh:42