director.transformUtils module

director.transformUtils.concatenateTransforms(transformList)[source]

Given a list of vtkTransform objects, returns a new vtkTransform which is a concatenation of the whole list using vtk post multiply. See documentation for vtkTransform::PostMultiply.

director.transformUtils.copyFrame(transform)[source]
director.transformUtils.crossProductMatrix(x)[source]

Computes the matrix P such that P*y = cross product of x and y :param x: :return: P, a 3x3 matrix

director.transformUtils.findTransformAxis(transform, referenceVector)[source]

Given a vtkTransform and a reference vector, find a +/- axis of the transform that most closely matches the reference vector. Returns the matching axis index, axis, and sign.

director.transformUtils.forceMomentTransformation(inputFrame, outputFrame)[source]

Utility getting the force-moment transformation for converting wrenches from one frame to another. Ff wrench is 6 x 1 (moment, force) expressed in input frame, then corresponding wrench in output frame would be numpy.dot(FM, wrench) = wrench_in_output_frame. :param inputFrame: A vtkTransform defining the input frame :param outputFrame: A vtkTransform defining the output frame :return: 4x4 matrix that transform a wrench from the input frame to the output frame

director.transformUtils.frameFromPositionAndRPY(position, rpy)[source]

rpy specified in degrees

director.transformUtils.frameInterpolate(trans_a, trans_b, weight_b)[source]

Interpolate two frames where weight_b=[0,1]

director.transformUtils.getAxesFromTransform(t)[source]
director.transformUtils.getLookAtTransform(lookAtPosition, lookFromPosition, viewUp=[0.0, 0.0, 1.0])[source]
director.transformUtils.getNumpyFromTransform(transform)[source]

Given a vtkTransform, return a numpy 4x4 array

director.transformUtils.getTransformFromAxes(xaxis, yaxis, zaxis)[source]
director.transformUtils.getTransformFromAxesAndOrigin(xaxis, yaxis, zaxis, origin)[source]
director.transformUtils.getTransformFromNumpy(mat)[source]

Given a numpy 4x4 array, return a vtkTransform.

director.transformUtils.getTransformFromOriginAndNormal(origin, normal, normalAxis=2)[source]
director.transformUtils.orientationFromAxes(xaxis, yaxis, zaxis)[source]
director.transformUtils.orientationFromNormal(normal)[source]

Creates a frame where the Z axis points in the direction of the given normal.

director.transformUtils.poseFromTransform(transform)[source]

Returns position, quaternion

director.transformUtils.quaternionToRollPitchYaw(quat)[source]
director.transformUtils.rollPitchYawFromTransform(t)[source]
director.transformUtils.rollPitchYawToQuaternion(rpy)[source]
director.transformUtils.transformFromPose(position, quaternion)[source]

Returns a vtkTransform