18 #ifndef _GEARBOXJOINT_HH_
19 #define _GEARBOXJOINT_HH_
60 public:
virtual void Load(sdf::ElementPtr _sdf)
63 if (_sdf->HasElement(
"gearbox_ratio"))
66 _sdf->Get<
double>(
"gearbox_ratio");
70 gzerr <<
"gearbox_ratio_not_specified, set to 1.\n";
71 this->gearRatio = 1.0;
78 if (_sdf->HasElement(
"gearbox_reference_body"))
81 _sdf->Get<std::string>(
"gearbox_reference_body");
85 gzerr <<
"Gearbox joint missing reference body.\n";
90 protected:
virtual void Init()
98 {
return this->gearRatio; }
105 public:
virtual void SetGearboxRatio(
double _gearRatio) = 0;
108 public:
virtual void FillMsg(msgs::Joint &_msg)
111 msgs::Joint::Gearbox *gearboxMsg = _msg.mutable_gearbox();
112 gearboxMsg->set_gearbox_reference_body(this->referenceBody);
113 gearboxMsg->set_gearbox_ratio(this->gearRatio);
virtual void Load(sdf::ElementPtr _sdf)
Load joint.
Definition: GearboxJoint.hh:60
std::string referenceBody
reference link/body for computing joint angles
Definition: GearboxJoint.hh:120
virtual unsigned int GetAngleCount() const
Definition: GearboxJoint.hh:55
GearboxJoint type.
Definition: Base.hh:112
#define gzerr
Output an error message.
Definition: Console.hh:50
virtual void Init()
Initialize joint.
Definition: GearboxJoint.hh:90
A double axis gearbox joint.
Definition: GearboxJoint.hh:44
virtual ~GearboxJoint()
Destructor.
Definition: GearboxJoint.hh:51
virtual double GetGearboxRatio() const
Get gearbox joint gear ratio.
Definition: GearboxJoint.hh:97
GearboxJoint(BasePtr _parent)
Constructor.
Definition: GearboxJoint.hh:48
double gearRatio
Gearbox gearRatio.
Definition: GearboxJoint.hh:117
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
virtual void FillMsg(msgs::Joint &_msg)
Definition: GearboxJoint.hh:108
virtual void FillMsg(msgs::Joint &_msg)
Fill a joint message.