ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# Continuous Joints Rotation Problem (PR2, JointTrajectoryAction)

Hi all,

I have a couple of problems with using the Joint Spline Trajectory Controller on the PR2. I used the controller through the provided action interface and followed this tutorial: http://www.ros.org/wiki/pr2_controllers/Tutorials/Moving%20the%20arm%20using%20the%20Joint%20Trajectory%20Action

Here are my questions:

1. For the continuous joints, in a few cases, the joint rotates towards the direction of the larger angle instead of the smaller one. The angles I am sending to the controller are normalized. How can I make sure I am rotating about the smaller angle?

2. The state publisher does not seem to normalize the angle of the continuous joints. Is that the correct behavior?

Best, Juergen

edit retag close merge delete

For #1, does this happen for the first point in your trajectory, or only for intermediate points?

( 2012-02-13 09:04:52 -0600 )edit

It happens for intermediate points. I think that I can recall a case where it also happend for the first one but I am not sure. I did not look out for that at the time.

( 2012-02-14 07:11:12 -0600 )edit

Sort by ยป oldest newest most voted

Given two consecutive joint angles a and b, if b > a, the controller will move in the positive direction, and if b < a it will move in the negative direction. It does not normalize the angles, nor does it choose the shorter angular distance to travel.

This interpretation allows you to command trajectories that move joints through more than 180 degrees, which would be impossible if the controller normalized angles or picked the direction implicitly.

To get the behavior you want, you should "denormalize" the joint angles of your trajectory before sending it to the controller.

more

Thanks for the clarification. I changed my joint trajectory accordingly. It works fine.

( 2012-02-15 07:27:35 -0600 )edit