Joint::SetPosition alterate the simulation

Issue #2111 resolved
vincentrou
created an issue

This is linked to an issue in gazebo_ros_pkgs where the use of a PositionJointInterface make the simulation unusable : https://github.com/ros-simulation/gazebo_ros_pkgs/issues/479

To reproduce the problem with gazebo and ROS you can use the rrbot on this branch : https://github.com/vincentrou/gazebo_ros_demos/tree/position_joint_interface

I find out that the ROS library calls Joint::SetPosition in gazebo.
At the end, gazebo call Link::MoveFrame.
In this commit,
a line was added by @John Hsu (this line seems to freeze the simulation if there is a parent joint)

this->SetWorldTwist(math::Vector3(0, 0, 0), math::Vector3(0, 0, 0));

When I remove this line everything seems to work again (like in gazebo 2).
Why this line has been added ? And should it be remove to fix the issue ?
I can make a PR.

Thank you for your great work on gazebo.

Comments (15)

  1. abdullah_dayem

    Just weighing in to say that I've experienced the same issue when mounting a UR5 arm on a Husky vehicle in gazebo7. The arm uses the PositionJointInterface and essentially acts as an anchor that prevents the vehicle from moving properly and causes it to float and descend slowly if dropped. This issue does not exist in gazebo2.

  2. vincentrou reporter

    To add some more visual information here is the problem, with the vehicle floating in the air and then slipping when trying to move forward
    https://drive.google.com/file/d/0BwQ8uAotSmFuZk5WMkNqRUJkeWs/view?usp=sharing

    Here is the desired behavior with the fix in the pull request #2598
    https://drive.google.com/file/d/0BwQ8uAotSmFucFhYemw3UXpkUm8/view?usp=sharing

    This has been done by launching this vehicle in gazebo : https://github.com/romea/robucar
    The vehicle has 4 VelocityJointInterface for the wheels speed and 2 JointPositionInterface for the front steering.

  3. RDaneelOlivaw

    Exact same problem here.
    I have to joints actuated with PositionJointInterface and limits those joints move at a maximum speed in space. Is there a plan for fixing this issue?
    Any provisional workaround?

  4. Ying Lu

    Note that the above comment is not true, I tried to fix this with a new PR, but it should be under review and NOT merged yet.
    Not sure why this issue checker automatically generated the above comment and marked the issue as resolved
    I didn't figure out a way to change it back to open or in review

  5. mikaelarguedas

    Good to know a PR to address this has been merged ! As it changes API, I suppose it will not be made available in gazebo7? Is there a suggested workaround for gazebo7 (the version used with ROS Kinetic, Lunar and upcoming Melodic)?

  6. Log in to comment