18 #ifndef _GEARBOXJOINT_HH_ 19 #define _GEARBOXJOINT_HH_ 41 : T(_parent), gearRatio(1.0)
48 public:
virtual unsigned int DOF()
const 53 public:
virtual void Load(sdf::ElementPtr _sdf)
56 if (_sdf->HasElement(
"gearbox_ratio"))
59 _sdf->Get<
double>(
"gearbox_ratio");
63 gzerr <<
"gearbox_ratio_not_specified, set to 1.\n";
64 this->gearRatio = 1.0;
71 if (_sdf->HasElement(
"gearbox_reference_body"))
74 _sdf->Get<std::string>(
"gearbox_reference_body");
78 gzerr <<
"Gearbox joint missing reference body.\n";
83 protected:
virtual void Init()
91 {
return this->gearRatio; }
98 public:
virtual void SetGearboxRatio(
double _gearRatio) = 0;
101 public:
virtual void FillMsg(msgs::Joint &_msg)
104 msgs::Joint::Gearbox *gearboxMsg = _msg.mutable_gearbox();
105 gearboxMsg->set_gearbox_reference_body(this->referenceBody);
106 gearboxMsg->set_gearbox_ratio(this->gearRatio);
virtual unsigned int DOF() const
Definition: GearboxJoint.hh:48
virtual void Load(sdf::ElementPtr _sdf)
Load joint.
Definition: GearboxJoint.hh:53
Forward declarations for the common classes.
Definition: Animation.hh:26
std::string referenceBody
reference link/body for computing joint angles
Definition: GearboxJoint.hh:113
GearboxJoint type.
Definition: Base.hh:107
#define gzerr
Output an error message.
Definition: Console.hh:50
virtual void Init()
Initialize joint.
Definition: GearboxJoint.hh:83
A double axis gearbox joint.
Definition: GearboxJoint.hh:36
virtual ~GearboxJoint()
Destructor.
Definition: GearboxJoint.hh:44
virtual double GetGearboxRatio() const
Get gearbox joint gear ratio.
Definition: GearboxJoint.hh:90
GearboxJoint(BasePtr _parent)
Constructor.
Definition: GearboxJoint.hh:40
double gearRatio
Gearbox gearRatio.
Definition: GearboxJoint.hh:110
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:78
virtual void FillMsg(msgs::Joint &_msg)
Definition: GearboxJoint.hh:101
virtual void FillMsg(msgs::Joint &_msg)
Fill a joint message.