From: Martin Günther Date: Fri, 16 Mar 2018 15:59:13 +0000 (+0100) Subject: Add fix for gazebo_ros_pkgs#612 X-Git-Tag: 0.1.0~6^2~2 X-Git-Url: http://git.ece.ufrgs.br/?a=commitdiff_plain;h=4522c863dd965281e0e9824e5c963109e65322ff;p=roboticsgroup_upatras_gazebo_plugins.git Add fix for gazebo_ros_pkgs#612 This issue also affects the mimic joint plugin: https://github.com/ros-simulation/gazebo_ros_pkgs/issues/612 The commit here fixes that issue for Gazebo 9. We should change the GAZEBO_MAJOR_VERSION check to >= 7 if the following PR gets backported to Gazebo 7 and 8: https://bitbucket.org/osrf/gazebo/pull-requests/2814/fix-issue-2111-by-providing-options-to/diff --- diff --git a/src/mimic_joint_plugin.cpp b/src/mimic_joint_plugin.cpp index 7a2c516..f9de9ee 100644 --- a/src/mimic_joint_plugin.cpp +++ b/src/mimic_joint_plugin.cpp @@ -169,7 +169,9 @@ namespace gazebo { mimic_joint_->SetForce(0, effort); } else { -#if GAZEBO_MAJOR_VERSION > 2 +#if GAZEBO_MAJOR_VERSION >= 9 + mimic_joint_->SetPosition(0, angle, true); +#elif GAZEBO_MAJOR_VERSION > 2 mimic_joint_->SetPosition(0, angle); #else mimic_joint_->SetAngle(0, math::Angle(angle));