-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #612 for Gazebo9 #688
Fix #612 for Gazebo9 #688
Conversation
This commit fixes ros-simulation#612, but only for Gazebo9. Fixing it for Gazebo7 (the version used in ROS Kinetic) requires the following PR to be backported to Gazebo 7 and 8: https://bitbucket.org/osrf/gazebo/pull-requests/2814/fix-issue-2111-by-providing-options-to/diff Once that PR has been backported, we can remove the GAZEBO_MAJOR_VERSION guards from this PR so that the fix is active for the older Gazebo versions as well. Tested on Gazebo7 (where it compiles, but doesn't change anything) and Gazebo9 (where it compiles and fixes the bug). I've tested it using the instructions I've put into this repo: https://github.com/mintar/mimic_joint_gazebo_tutorial
#if GAZEBO_MAJOR_VERSION >= 4 | ||
#if GAZEBO_MAJOR_VERSION >= 9 | ||
sim_joints_[j]->SetPosition(0, joint_position_command_[j], true); | ||
#elif GAZEBO_MAJOR_VERSION >= 4 | ||
sim_joints_[j]->SetPosition(0, joint_position_command_[j]); | ||
#else | ||
sim_joints_[j]->SetAngle(0, joint_position_command_[j]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinetic requires gazebo7 so we can ditch SetAngle
and just put the old SetPosition
call in an #else
block
Please verify that the following plan should get rid of #612. Also, if this is an inappropriate place to ask such a question then kindly let me know where I ought to take it. My computer currently has ros-kinetic-gazebo9-ros-control installed via apt, so here's the plan:
Is there anything I need to do in order to get behavior #612 to stop or will this version of gazebo_ros_pkgs automatically take care of that? |
It would probably have been better if you had asked this question directly at #612, but here is also okay. What this PR does is that it makes gazebo_ros_pkgs use a feature that was introduced in Gazebo 9. So you'll need both Gazebo 9 (from debs is okay) and the newest version of gazebo_ros_pkgs (from source, until the next release happens). So you plan is fine, except that you should not remove Gazebo 9. Afterwards, the bug #612 should be fixed for you. |
Thanks again! With that information in hand, I will simply execute the final four lines in my plan above. edit: After installing this version of gazebo_ros_pkgs, the bug is fixed as predicted. |
* Fix ros-simulation#612 for Gazebo9 This commit fixes ros-simulation#612, but only for Gazebo9. Fixing it for Gazebo7 (the version used in ROS Kinetic) requires the following PR to be backported to Gazebo 7 and 8: https://bitbucket.org/osrf/gazebo/pull-requests/2814/fix-issue-2111-by-providing-options-to/diff Once that PR has been backported, we can remove the GAZEBO_MAJOR_VERSION guards from this PR so that the fix is active for the older Gazebo versions as well. Tested on Gazebo7 (where it compiles, but doesn't change anything) and Gazebo9 (where it compiles and fixes the bug). I've tested it using the instructions I've put into this repo: https://github.com/mintar/mimic_joint_gazebo_tutorial * remove old ifdef
This commit fixes #612, but only for Gazebo9. Fixing it for Gazebo7
(the version used in ROS Kinetic) requires the following PR to be
backported to Gazebo 7 and 8:
https://bitbucket.org/osrf/gazebo/pull-requests/2814/fix-issue-2111-by-providing-options-to/diff
Once that PR has been backported, we can remove the GAZEBO_MAJOR_VERSION
guards from this PR so that the fix is active for the older Gazebo
versions as well.
Tested on Gazebo7 (where it compiles, but doesn't change anything) and
Gazebo9 (where it compiles and fixes the bug). I've tested it using the
instructions I've put into this repo:
https://github.com/mintar/mimic_joint_gazebo_tutorial