- offset
A **double** specifying the offset parameter of the mimic joint. Defaults to 0.0.
+ - sensitiveness
+
+ A **double** specifying the sensitiveness of the mimic joint. Defaults to 0.0. It basically is the threshold of the difference between the 2 angles (joint's and mimic's) before applying the "mimicness".
###DisableLinkPlugin
<license>BSD</license>
- <url type="repository">https://github.com/costashatz/gazebo_plugins</url>
- <url type="bugtracker">https://github.com/costashatz/gazebo_plugins/issues</url>
+ <url type="repository">https://github.com/roboticsgroup/roboticsgroup_gazebo_plugins</url>
+ <url type="bugtracker">https://github.com/roboticsgroup/roboticsgroup_gazebo_plugins/issues</url>
<author email="costashatz@gmail.com">Konstantinos Chatzilygeroudis</author>
if (_sdf->HasElement("offset"))
offset_ = _sdf->GetElement("offset")->Get<double>();
+ // Check for sensitiveness element
+ sensitiveness_ = 0.0;
+ if (_sdf->HasElement("sensitiveness"))
+ sensitiveness_ = _sdf->GetElement("sensitiveness")->Get<double>();
+
// Get pointers to joints
joint_ = model_->GetJoint(joint_name_);
if(!joint_)
void MimicJointPlugin::UpdateChild()
{
// Set mimic joint's angle based on joint's angle
- mimic_joint_->SetAngle(0, math::Angle(joint_->GetAngle(0).Radian()*multiplier_+offset_));
+ if(abs((joint_->GetAngle(0).Radian()*multiplier_+offset_)-mimic_joint_->GetAngle(0).Radian())>=sensitiveness_)
+ mimic_joint_->SetAngle(0, math::Angle(joint_->GetAngle(0).Radian()*multiplier_+offset_));
}
GZ_REGISTER_MODEL_PLUGIN(MimicJointPlugin);
\ No newline at end of file