12 if (!_sdf->HasElement(
"jointName"))
14 ROS_FATAL(
"mimic_joint missing <jointName>, cannot proceed");
18 this->
joint_name_ = _sdf->GetElement(
"jointName")->Get<std::string>();
21 if (!_sdf->HasElement(
"mimicJoint"))
23 ROS_FATAL(
"mimic_joint missing <mimicJoint>, cannot proceed");
30 if (!_sdf->HasElement(
"offset"))
32 ROS_INFO(
"mimic_joint missing <offset>, set default to 0.0");
36 this->
offset_ = _sdf->GetElement(
"offset")->Get<
double>();
38 if (!_sdf->HasElement(
"multiplier"))
40 ROS_INFO(
"mimic_joint missing <multiplier>, set default to 1.0");
44 this->
multiplier_ = _sdf->GetElement(
"multiplier")->Get<
double>();
51 #if GAZEBO_MAJOR_VERSION > 2
52 this->joint_->SetParam(
"fmax", 0, 100.0);
54 this->joint_->SetMaxForce(0, 100.0);
65 #if GAZEBO_MAJOR_VERSION >= 8
71 #if GAZEBO_MAJOR_VERSION >= 9
72 this->
joint_->SetPosition(0, desired_angle,
true);
74 this->
joint_->SetPosition(0, desired_angle);