As mentioned in the documentation you linked, Target orientation of the end effector relative to the reference body, specified as four-element vector that represents a unit quaternion. A quaternion is composed of four components: (q = [w, x, y, z]), where (w) is the real part, and (x), (y), and (z) form the vector part. This quaternion represents a rotation in 3D space, where:
- (w): Represents the cosine of half the rotation angle.
- (x, y, z): Represent the axis of rotation, scaled by the sine of half the rotation angle.
The unit quaternion (where the magnitude is 1) ensures that the rotation is purely orientational without any scaling.
Default Orientation ([1, 0, 0, 0]): This quaternion represents no rotation from the reference frame. If the end effector's TargetOrientation is set to this, it means the end effector is expected to maintain its current orientation with respect to the reference body's frame without any additional rotation.
For example, suppose you want the end effector to be rotated by 90 degrees around the Z-axis relative to the reference body. This rotation can be represented by a quaternion. The quaternion for a 90-degree rotation around the Z-axis is calculated as follows:
- Angle(theta): 90 degrees or pi/2 radians.
- Rotation Axis: Z-axis, which is represented as ([0, 0, 1]) in 3D space.
Using the formula for a quaternion representing a rotation:
[q = [cos(theta/2), sin(theta/2)*axisX, sin(theta/2)*axisY, sin(theta/2)* axisZ]
For a 90-degree rotation around the Z-axis:
[q = [cos(pi/4), 0*sin(pi/4), 0*sin(pi/4), 1*sin(pi/4)] = [0.7071, 0, 0, 0.7071]]
So, if you want the end effector to achieve this orientation relative to the reference body, you would set:
fixOrientation.TargetOrientation = [0.7071, 0, 0, 0.7071];
Hope this helps!