-
Notifications
You must be signed in to change notification settings - Fork 524
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
JointTrajectory: Don't use shortest_angular_distance for linear joints #623
base: noetic-devel
Are you sure you want to change the base?
Conversation
@steinmn could you please nod in agreement? ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nod :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, something doesn't look quite right here
if (is_linear_[joint_index]) | ||
{ | ||
state_joint_error_.position[0] = desired_joint_state_.position[0] - current_state_.position[joint_index]; | ||
} | ||
else | ||
{ | ||
state_joint_error_.position[0] = angles::shortest_angular_distance(current_state_.position[joint_index],desired_joint_state_.position[0]); | ||
} | ||
state_joint_error_.velocity[0] = desired_joint_state_.velocity[0] - current_state_.velocity[joint_index]; | ||
state_joint_error_.acceleration[0] = 0.0; | ||
|
||
state_error_.position[joint_index] = angles::shortest_angular_distance(current_state_.position[joint_index],desired_joint_state_.position[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (is_linear_[joint_index]) | |
{ | |
state_joint_error_.position[0] = desired_joint_state_.position[0] - current_state_.position[joint_index]; | |
} | |
else | |
{ | |
state_joint_error_.position[0] = angles::shortest_angular_distance(current_state_.position[joint_index],desired_joint_state_.position[0]); | |
} | |
state_joint_error_.velocity[0] = desired_joint_state_.velocity[0] - current_state_.velocity[joint_index]; | |
state_joint_error_.acceleration[0] = 0.0; | |
state_error_.position[joint_index] = angles::shortest_angular_distance(current_state_.position[joint_index],desired_joint_state_.position[0]); | |
if (is_linear_[joint_index]) | |
{ | |
state_error_.position[joint_index] = desired_joint_state_.position[0] - current_state_.position[joint_index]; | |
} | |
else | |
{ | |
state_error_.position[joint_index] = angles::shortest_angular_distance(current_state_.position[joint_index],desired_joint_state_.position[0]); | |
} |
Fixes #432
Port #591 to Noetic