ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Continuous Joints Rotation Problem (PR2, JointTrajectoryAction)

asked 2012-02-13 08:18:47 -0500

updated 2014-11-22 17:05:30 -0500

ngrennan gravatar image

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:

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 flag offensive close merge delete


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

sglaser gravatar image sglaser  ( 2012-02-13 09:04:52 -0500 )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.

JuergenHess gravatar image JuergenHess  ( 2012-02-14 07:11:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-02-14 13:18:27 -0500

sglaser gravatar image

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.

edit flag offensive delete link more


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

JuergenHess gravatar image JuergenHess  ( 2012-02-15 07:27:35 -0500 )edit

Question Tools


Asked: 2012-02-13 08:18:47 -0500

Seen: 519 times

Last updated: Feb 14 '12