Path constraint in euler coordinates?
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
with OMPL? MoveIt? or what?
Sorry I did not mention this explicitly (although I tagged moveit :p). Yes, with MoveIt!, e.g. by using group.set_path_constraints().