18 #ifndef _GEARBOXJOINT_HH_
19 #define _GEARBOXJOINT_HH_
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; }
104 public:
virtual void SetGearboxRatio(
double _gearRatio) = 0;
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:68
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:318
virtual double GetGearboxRatio() const
Get gearbox joint gear ratio.
Definition: GearboxJoint.hh:96
double gearRatio
Gearbox gearRatio.
Definition: GearboxJoint.hh:107
GearboxJoint(BasePtr _parent)
Constructor.
Definition: GearboxJoint.hh:47
virtual unsigned int GetAngleCount() const
Definition: GearboxJoint.hh:54
#define gzerr
Output an error message.
Definition: Console.hh:49
A double axis gearbox joint.
Definition: GearboxJoint.hh:43
virtual void Init()
Initialize joint.
Definition: GearboxJoint.hh:89
virtual ~GearboxJoint()
Destructor.
Definition: GearboxJoint.hh:50
std::string referenceBody
reference link/body for computing joint angles
Definition: GearboxJoint.hh:110
GearboxJoint type.
Definition: Base.hh:117
virtual void Load(sdf::ElementPtr _sdf)
Load joint.
Definition: GearboxJoint.hh:59
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.