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

joint_trajectory_controller - wraparoundOffset #263

Closed
progtologist opened this issue Apr 5, 2017 · 0 comments
Closed

joint_trajectory_controller - wraparoundOffset #263

progtologist opened this issue Apr 5, 2017 · 0 comments

Comments

@progtologist
Copy link
Member

Perhaps I have misunderstood the usage of the wraparoundOffset(...) function, but I think the math is wrong in it. The simple version of the math is:

double dist = angles::shortest_angular_distance(previous, next);
if (std::abs(dist) - M_PI < 1e-9)
{
    dist = next > previous ? std::abs(dist) : -std::abs(dist);
}
offset = (previous + dist) - next;

So if one queries for a rotation starting from -90 degrees to 180 degrees, the offset would then be equal to -180.
Therefore the commanded "next" position would evaluate to:

next.position = next.position + offset;

0 degrees, which is not correct.

Am I missing something here?

graiola added a commit to graiola/ros_controllers that referenced this issue May 15, 2017
graiola added a commit to graiola/ros_controllers that referenced this issue Jun 17, 2017
graiola added a commit to graiola/ros_controllers that referenced this issue Jun 17, 2017
bmagyar added a commit that referenced this issue Jun 27, 2017
Address issue #263, joint_trajectory_controller - wraparoundOffset
@graiola graiola closed this as completed Jun 27, 2017
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

No branches or pull requests

2 participants