18#ifndef _GEARBOXJOINT_HH_
19#define _GEARBOXJOINT_HH_
47 : T(_parent), gearRatio(1.0)
54 public:
virtual unsigned int DOF()
const
59 public:
virtual void Load(sdf::ElementPtr _sdf)
62 if (_sdf->HasElement(
"gearbox_ratio"))
65 _sdf->Get<
double>(
"gearbox_ratio");
69 gzerr <<
"gearbox_ratio_not_specified, set to 1.\n";
70 this->gearRatio = 1.0;
77 if (_sdf->HasElement(
"gearbox_reference_body"))
80 _sdf->Get<std::string>(
"gearbox_reference_body");
84 gzerr <<
"Gearbox joint missing reference body.\n";
89 protected:
virtual void Init()
97 {
return this->gearRatio; }
107 public:
virtual void FillMsg(msgs::Joint &_msg)
110 msgs::Joint::Gearbox *gearboxMsg = _msg.mutable_gearbox();
111 gearboxMsg->set_gearbox_reference_body(this->referenceBody);
112 gearboxMsg->set_gearbox_ratio(this->gearRatio);
@ GEARBOX_JOINT
GearboxJoint type.
Definition: Base.hh:112
A double axis gearbox joint.
Definition: GearboxJoint.hh:43
std::string referenceBody
reference link/body for computing joint angles
Definition: GearboxJoint.hh:119
double gearRatio
Gearbox gearRatio.
Definition: GearboxJoint.hh:116
virtual ~GearboxJoint()
Destructor.
Definition: GearboxJoint.hh:50
virtual void Init()
Initialize joint.
Definition: GearboxJoint.hh:89
GearboxJoint(BasePtr _parent)
Constructor.
Definition: GearboxJoint.hh:46
virtual double GetGearboxRatio() const
Get gearbox joint gear ratio.
Definition: GearboxJoint.hh:96
virtual void SetGearboxRatio(double _gearRatio)=0
Set gearbox joint gear ratio.
virtual void Load(sdf::ElementPtr _sdf)
Load joint.
Definition: GearboxJoint.hh:59
virtual void FillMsg(msgs::Joint &_msg)
Definition: GearboxJoint.hh:107
virtual unsigned int DOF() const
Definition: GearboxJoint.hh:54
virtual void FillMsg(msgs::Joint &_msg)
Fill a joint message.
#define gzerr
Output an error message.
Definition: Console.hh:50
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
Forward declarations for the common classes.
Definition: Animation.hh:27