64 ROS_ERROR(
"Parent model is NULL! MimicJointPlugin could not be loaded.");
71 ROS_ERROR(
"A ROS node for Gazebo has not been initialized, unable to load plugin.");
77 if(_sdf->HasElement(
"robotNamespace"))
83 if(!_sdf->HasElement(
"joint"))
85 ROS_ERROR(
"No joint element present. MimicJointPlugin could not be loaded.");
89 joint_name_ = _sdf->GetElement(
"joint")->Get<std::string>();
92 if(!_sdf->HasElement(
"mimicJoint"))
94 ROS_ERROR(
"No mimicJoint element present. MimicJointPlugin could not be loaded.");
102 if(_sdf->HasElement(
"hasPID"))
109 nh.
param(
"p", p, 0.0);
110 nh.
param(
"i", i, 0.0);
111 nh.
param(
"d", d, 0.0);
118 if(_sdf->HasElement(
"multiplier"))
119 multiplier_ = _sdf->GetElement(
"multiplier")->Get<
double>();
123 if (_sdf->HasElement(
"offset"))
124 offset_ = _sdf->GetElement(
"offset")->Get<
double>();
128 if (_sdf->HasElement(
"sensitiveness"))
129 sensitiveness_ = _sdf->GetElement(
"sensitiveness")->Get<
double>();
133 if (_sdf->HasElement(
"maxEffort"))
135 max_effort_ = _sdf->GetElement(
"maxEffort")->Get<
double>();
155 #if GAZEBO_MAJOR_VERSION > 2 182 double error = angle-a;
187 #if GAZEBO_MAJOR_VERSION >= 4
control_toolbox::Pid pid_
ROSCPP_DECL bool isInitialized()
std::string robot_namespace_
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
event::ConnectionPtr updateConnection
void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
GZ_REGISTER_MODEL_PLUGIN(DisableLinkPlugin)
std::string mimic_joint_name_
physics::JointPtr mimic_joint_