Skip to content

fix behavior for multi-turn revolute joints#264

Closed
codebot wants to merge 1 commit intoros-controls:kinetic-develfrom
codebot:kinetic-devel
Closed

fix behavior for multi-turn revolute joints#264
codebot wants to merge 1 commit intoros-controls:kinetic-develfrom
codebot:kinetic-devel

Conversation

@codebot
Copy link
Copy Markdown

@codebot codebot commented Apr 6, 2017

Previously, the behavior of revolute joints was unexpected when
the joint limits extended beyond [-pi, pi] due to unwrapping
happening in a few places in the angles package, which was called
from the joint position controller. This PR checks to see if the
range of motion extends beyond [-pi, pi] and, if so, goes directly
to the (clamped) target, rather than trying to unwrap the current
or target angles to find the shortest path.

Previously, the behavior of revolute joints was unexpected when
the joint limits extended beyond [-pi, pi] due to unwrapping
happening in a few places in the angles package, which was called
from the joint position controller. This PR checks to see if the
range of motion extends beyond [-pi, pi] and, if so, goes directly
to the (clamped) target, rather than trying to unwrap the current
or target angles to find the shortest path.
@bmagyar bmagyar requested a review from graiola April 7, 2017 11:22
@graiola
Copy link
Copy Markdown
Member

graiola commented Apr 11, 2017

Hello,

Could you show me a situation where the behavior is unexpected?
I am testing the code with and without the pr, but I don't see any difference.
Is the issue related to a different version of angles package? (I am testing with kinetic)

Thanks

Copy link
Copy Markdown
Member

@graiola graiola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @codebot

@IanTheEngineer
Copy link
Copy Markdown

@codebot @graiola I've experienced the same issue within the default_robot_hw_sim interface from gazebo_ros_control:
https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_ros_control/src/default_robot_hw_sim.cpp#L338-L342
Any measured angle from Gazebo that is outside of -pi to pi is forced to be within that range. This is a problem for Sawyer, as the seventh joint has a range -4.15 to 4.15 rad. I can handle fixing Sawyer, but we should address this for the larger community.

Rather than fixing it here, shouldn't we just modify the angles shortest_angular_distance_with_limits to handle larger joint limits properly?

@bmagyar
Copy link
Copy Markdown
Member

bmagyar commented Apr 24, 2018 via email

@IanTheEngineer
Copy link
Copy Markdown

IanTheEngineer commented Apr 24, 2018

@bmagyar hmm, on further investigation, I'm experiencing the joint limits being reported directly from Gazebo7 as being truncated to a reduced range. That doesn't mean that the shortest_angular_distance_with_limits is correct, but rather that this whole thing requires more investigation. I'll add more color (and possibly unit tests) to this as I grok the underlying issue better.

@bmagyar
Copy link
Copy Markdown
Member

bmagyar commented Apr 23, 2020

I think we addressed this in #477 and #466 , please reopen if not.

@bmagyar bmagyar closed this Apr 23, 2020
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.

4 participants