From 4522c863dd965281e0e9824e5c963109e65322ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20G=C3=BCnther?= Date: Fri, 16 Mar 2018 16:59:13 +0100 Subject: [PATCH] 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 --- src/mimic_joint_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- 2.12.0