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);
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:259
virtual double GetGearboxRatio() const
Get gearbox joint gear ratio.
Definition: GearboxJoint.hh:97
double gearRatio
Gearbox gearRatio.
Definition: GearboxJoint.hh:117
virtual void FillMsg(msgs::Joint &_msg)
Fill a joint message.
GearboxJoint(BasePtr _parent)
Constructor.
Definition: GearboxJoint.hh:48
virtual unsigned int GetAngleCount() const
Definition: GearboxJoint.hh:55
#define gzerr
Output an error message.
Definition: Console.hh:49
A double axis gearbox joint.
Definition: GearboxJoint.hh:44
virtual void Init()
Initialize joint.
Definition: GearboxJoint.hh:90
virtual ~GearboxJoint()
Destructor.
Definition: GearboxJoint.hh:51
virtual void FillMsg(msgs::Joint &_msg)
Definition: GearboxJoint.hh:108
std::string referenceBody
reference link/body for computing joint angles
Definition: GearboxJoint.hh:120
GearboxJoint type.
Definition: Base.hh:117
virtual void Load(sdf::ElementPtr _sdf)
Load joint.
Definition: GearboxJoint.hh:60
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.