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

State error calculation not accounting for wrapping joint positions #275

Closed
bponsler opened this issue May 13, 2017 · 1 comment
Closed
Assignees

Comments

@bponsler
Copy link
Contributor

The following line in joint_trajectory_controller_impl.h is not properly handling wrapping joint angles:

state_error_.position[i] = desired_state_.position[i] - current_state_.position[i];

If the current joint position changes from -PI to PI this calculation will produce a large difference value which causes the joint to move very fast toward that new value.

I believe the following would properly account for this issue:

state_error_.position[i] = angles::shortest_angular_distance(current_state_.position[i] - desired_state_.position[i]);
@graiola graiola self-assigned this May 13, 2017
@graiola
Copy link
Member

graiola commented May 13, 2017

Hi Brett,

Thanks for the detailed report! (#274)
Could I ask you to open a pull request with the code you've attached to this issue, feel free to add a test to our current test-suite. We should see how the rest of the tests behave.

bponsler added a commit to bponsler/ros_controllers that referenced this issue May 16, 2017
Fix for issue ros-controls#275 (State error calculation not accounting for wrapping joint positions).
graiola added a commit to graiola/ros_controllers that referenced this issue May 22, 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
bponsler added a commit to bponsler/ros_controllers that referenced this issue Jun 21, 2017
Fix for issue ros-controls#275 (State error calculation not accounting for wrapping joint positions)
bponsler added a commit to bponsler/ros_controllers that referenced this issue Jun 21, 2017
graiola pushed a commit to graiola/ros_controllers that referenced this issue Jun 22, 2017
graiola pushed a commit to graiola/ros_controllers that referenced this issue Jun 24, 2017
@graiola graiola closed this as completed Jun 27, 2017
bmagyar added a commit that referenced this issue Jun 28, 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