Skip to content
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

Merged
merged 2 commits into from
Mar 17, 2018
Merged

Conversation

mintar
Copy link

@mintar mintar commented Mar 16, 2018

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

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]);
Copy link
Member

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

@scpeters scpeters merged commit 3164e4c into ros-simulation:kinetic-devel Mar 17, 2018
@mintar mintar deleted the fix_612_gazebo9 branch March 18, 2018 16:27
@raequin
Copy link

raequin commented Mar 20, 2018

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:

sudo apt remove --purge ros-kinetic-gazebo9-ros-control ros-kinetic-gazebo9-ros-pkgs

cd ~/catkin_ws/src

git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b kinetic-devel

cd ~/catkin_ws/

catkin_make

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?

@mintar
Copy link
Author

mintar commented Mar 20, 2018

if this is an inappropriate place to ask such a question then kindly let me know where I ought to take it.

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.

@raequin
Copy link

raequin commented Mar 20, 2018

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.

Roboterbastler pushed a commit to Roboterbastler/gazebo_ros_pkgs that referenced this pull request Jul 6, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gazebo_ros_control] Strange behaviour when adding gazebo_ros_control to a robot
3 participants