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

Path constraint in euler coordinates?

asked 2014-12-18 08:25:22 -0500

updated 2014-12-19 03:29:33 -0500

I want to create a motion plan with the gripper/end effector in a fixed orientation, e.g. pointing downwards. In euler coordinates this means the roll and pitch are fixed (roll = 0, pitch = pi/2) and the yaw may freely defined. However, the orientation constraints are defined using quaternions (x, y, z, w), and as far as I understand my constraint cannot be specified using quaternions. Or am I missing something?

How can I constrain the orientation of the end effector as described? Is this possible?

(Preferably Python solutions, but any help is appreciated.)

UPDATE: To give an example of what I mean, see the following possible orientations, each with the end effectuator pointed downwards, but rotated around the z-axis (in the cartesion frame), in steps of 45 degrees (=pi/4). In euler coordinates, it's clear that "roll" should be fixed to 0 and "pitch" to 1.571 (=pi/2), and that "yaw" defines the rotation about the z-axis. But how could I constrain this using quaternions? The x, y, z and w value all change when I only change the yaw in euler coordinates...

euler:                                   --> quaternion:
roll = 0.000, pitch = 1.571, yaw = 0.000 --> x =  0.0000, y =  0.7071, z =  0.0000, w =  0.7071
roll = 0.000, pitch = 1.571, yaw = 0.785 --> x = -0.2706, y =  0.6533, z =  0.2706, w =  0.6533
roll = 0.000, pitch = 1.571, yaw = 1.571 --> x = -0.5000, y =  0.5000, z =  0.5000, w =  0.5000
roll = 0.000, pitch = 1.571, yaw = 2.356 --> x = -0.6533, y =  0.2706, z =  0.6533, w =  0.2706
roll = 0.000, pitch = 1.571, yaw = 3.142 --> x = -0.7071, y =  0.0000, z =  0.7071, w =  0.0000
roll = 0.000, pitch = 1.571, yaw = 3.927 --> x = -0.6533, y = -0.2706, z =  0.6533, w = -0.2706
roll = 0.000, pitch = 1.571, yaw = 4.712 --> x = -0.5000, y = -0.5000, z =  0.5000, w = -0.5000
roll = 0.000, pitch = 1.571, yaw = 5.498 --> x = -0.2706, y = -0.6533, z =  0.2706, w = -0.6533
roll = 0.000, pitch = 1.571, yaw = 6.283 --> x =  0.0000, y =  0.7071, z =  0.0000, w =  0.7071
edit retag flag offensive close merge delete

Comments

with OMPL? MoveIt? or what?

Andromeda gravatar image Andromeda  ( 2014-12-18 08:27:04 -0500 )edit

Sorry I did not mention this explicitly (although I tagged moveit :p). Yes, with MoveIt!, e.g. by using group.set_path_constraints().

wouter_tnl gravatar image wouter_tnl  ( 2014-12-18 08:50:14 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-12-18 10:04:42 -0500

Airuno2L gravatar image

updated 2014-12-19 09:59:07 -0500

Taken from here

Will something like this work from their example?

moveit_msgs::OrientationConstraint ocm;
ocm.link_name = "r_wrist_roll_link";
ocm.header.frame_id = "base_link";
ocm.orientation.x = -0.5;
ocm.orientation.y = 0.5;
ocm.orientation.z = 0.5;
ocm.orientation.w = 0.5;
ocm.absolute_x_axis_tolerance = 0.01;
ocm.absolute_y_axis_tolerance = 0.01;
ocm.absolute_z_axis_tolerance = 2*pi;
ocm.weight = 1.0;

Essentially you're fully defining the orientation, but telling the solver the rotation around the Z axis (Yaw) can be any value.

edit flag offensive delete link more

Comments

Thanks for your answer. I've updated my question to make more clear what I mean. In euler coordinates I want to fix the roll & pitch and "don't care about" the yaw. However, in your example I have to specify quaternions, so what are the axes I don't care about?!

wouter_tnl gravatar image wouter_tnl  ( 2014-12-19 03:32:39 -0500 )edit
1

Yeah anytime quaternions are involved things get confusing, but with this specific message you specify the orientation with a quaternion, then specify the tolerances in terms of axis-angles.

Airuno2L gravatar image Airuno2L  ( 2014-12-19 07:29:10 -0500 )edit

From here: Roll is a rotation around X, Pitch is Y, and Yaw is Z, you want a loose tolerance on your Z axis. You can even make the Z tolerance 2*PI so it can be anything, and make the X and Y tolerance small (eg .01)

Airuno2L gravatar image Airuno2L  ( 2014-12-19 07:31:38 -0500 )edit

I think you're right! The x/y/z in the tolerances refer to the cartesian axes, not to the x/y/z values in the quaternion (or I don't quaternions correctly...). Unfortunately motion planning with path constraints doesn't work really well yet, but that's another problem :)

wouter_tnl gravatar image wouter_tnl  ( 2014-12-19 08:39:25 -0500 )edit

PS: If you update your answer to have the z-axis tolerance set to 2*PI (as mentioned in your comment), and the initial orientation to e.g. x=-0.5, y=0.5, z=0.5, w=0.5 (as mentioned in the question), I'll accept this as the correct answer.

wouter_tnl gravatar image wouter_tnl  ( 2014-12-19 08:51:20 -0500 )edit

updated it, good luck

Airuno2L gravatar image Airuno2L  ( 2014-12-19 09:59:32 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-12-18 08:25:22 -0500

Seen: 731 times

Last updated: Dec 19 '14