Codota Logo
AxisAngle4d.getX
Code IndexAdd Codota to your IDE (free)

How to use
getX
method
in
javax.vecmath.AxisAngle4d

Best Java code snippets using javax.vecmath.AxisAngle4d.getX (Showing top 20 results out of 315)

  • Common ways to obtain AxisAngle4d
private void myMethod () {
AxisAngle4d a =
  • Codota Iconnew AxisAngle4d()
  • Codota IconVector3d axis;new AxisAngle4d(axis, angle)
  • Smart code suggestions by Codota
}
origin: us.ihmc/IHMCCommunication

/**
* Checks the validity of a {@link AxisAngle4d}
* @param axisAngleToCheck
* @return null if the axisAngle4d is valid, or the error message.
*/
public static ObjectErrorType validateAxisAngle4d(AxisAngle4d axisAngleToCheck)
{
 if (axisAngleToCheck == null)
   return ObjectErrorType.NULL;
 if (isNaN(axisAngleToCheck.getX()) || isNaN(axisAngleToCheck.getY()) || isNaN(axisAngleToCheck.getZ()) || isNaN(axisAngleToCheck.getAngle()))
   return ObjectErrorType.CONTAINS_NaN;
 if (isInfinite(axisAngleToCheck.getX()) || isInfinite(axisAngleToCheck.getY()) || isInfinite(axisAngleToCheck.getZ())
    || isInfinite(axisAngleToCheck.getAngle()))
   return ObjectErrorType.CONTAINS_INFINITY;
 return null;
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Rotates the given {@code tupleOriginal} tuple by a axis-angle (ux, uy, uz, angle) and stores the result in the tuple {@code tupleTransformed}.
* 
* @param axisAngle the axis-angle used to rotate the tuple.
* @param tupleOriginal the original tuple. Not modified.
* @param tupleTransformed the tuple in which the transformed {@code original} is stored. Modified.
*/
public static void rotateTuple3d(AxisAngle4d axisAngle, Tuple3d tupleOriginal, Tuple3d tupleTransformed)
{
 double uNorm = Math.sqrt(axisAngle.getX() * axisAngle.getX() + axisAngle.getY() * axisAngle.getY() + axisAngle.getZ() * axisAngle.getZ());
 if (uNorm < EPSILON)
 {
   return;
 }
 else
 {
   double halfTheta = 0.5 * axisAngle.getAngle();
   double cosHalfTheta = Math.cos(halfTheta);
   double sinHalfTheta = Math.sin(halfTheta) / uNorm;
   rotateTuple3d(axisAngle.getX() * sinHalfTheta, axisAngle.getY() * sinHalfTheta, axisAngle.getZ() * sinHalfTheta, cosHalfTheta, tupleOriginal, tupleTransformed);
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Convert AxisAngle representation to rotation matrix and store as
* rotational component of this transform.
*
* @param axisAngle
*/
public void setRotation(AxisAngle4d axisAngle)
{
 setRotationWithAxisAngle(axisAngle.getX(), axisAngle.getY(), axisAngle.getZ(), axisAngle.getAngle());
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void convertQuaternionToRotationVector(Quat4d quaternion, Vector3d rotationVectorToPack)
{
 AxisAngle4d axisAngle = axisAngleForRotationVectorConvertor.get();
 axisAngle.set(quaternion);
 rotationVectorToPack.set(axisAngle.getX(), axisAngle.getY(), axisAngle.getZ());
 rotationVectorToPack.scale(axisAngle.getAngle());
}
origin: us.ihmc/IHMCJavaFXToolkit

public void setOrientation(AxisAngle4d orientation)
{
 rotationAngleDecoupled = orientation.getAngle();
 rotationAxisDecoupled = new Point3D(orientation.getX(), orientation.getY(), orientation.getZ());
 setOrientation(rotationAxisDecoupled, rotationAngleDecoupled);
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This computes: resultToPack = log(q)
* @param q is a unit quaternion and describes a orientation.
* @param resultToPack is used to store the result and is a pure quaternion (w = 0.0).
*/
public void log(Quat4d q, Quat4d resultToPack)
{
 axisAngleForLog.set(q);
 resultToPack.set(axisAngleForLog.getX(), axisAngleForLog.getY(), axisAngleForLog.getZ(), 0.0);
 resultToPack.scale(axisAngleForLog.getAngle());
}
origin: us.ihmc/IHMCRoboticsToolkit

public double getAxisAngleRotationToOtherPose(FramePose otherPose, FrameVector rotationAxisToPack)
{
 AxisAngle4d rotationAxisAngle = new AxisAngle4d();
 getAxisAngleRotationToOtherPose(otherPose, rotationAxisAngle);
 rotationAxisToPack.setIncludingFrame(this.referenceFrame, rotationAxisAngle.getX(), rotationAxisAngle.getY(), rotationAxisAngle.getZ());
 return rotationAxisAngle.getAngle();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This computes: resultToPack = log(q)
* @param q is a unit quaternion and describes a orientation.
* @param resultToPack is used to store the result.
*/
public void log(Quat4d q, Vector3d resultToPack)
{
 axisAngleForLog.set(q);
 resultToPack.set(axisAngleForLog.getX(), axisAngleForLog.getY(), axisAngleForLog.getZ());
 resultToPack.scale(axisAngleForLog.getAngle());
}
origin: us.ihmc/IHMCRoboticsToolkit

  public static boolean axisAngleEpsilonEqualsIgnoreFlippedAxes(AxisAngle4d original, AxisAngle4d result, double epsilon)
  {
   if (original.epsilonEquals(result, epsilon))
   {
     return true;
   }
   else
   {
     AxisAngle4d originalNegated = originalAxisAngleForEpsilonEquals.get();
     originalNegated.set(original);
     originalNegated.setAngle(originalNegated.getAngle() * -1.0);
     originalNegated.setX(originalNegated.getX() * -1.0);
     originalNegated.setY(originalNegated.getY() * -1.0);
     originalNegated.setZ(originalNegated.getZ() * -1.0);

     return originalNegated.epsilonEquals(result, epsilon);
   }
  }
}
origin: us.ihmc/IHMCRoboticsToolkit

private DenseMatrix64F getSpatialErrorEndEffectorDesired()
{
 transformEndEffectorToDesired.getTranslation(errorTranslationVector);
 transformEndEffectorToDesired.getRotation(errorQuat);
 errorAxisAngle.set(errorQuat);
 errorAngularVector.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorAngularVector.scale(errorAxisAngle.getAngle());
 MatrixTools.setDenseMatrixFromTuple3d(spatialError, errorAngularVector, 0, 0);
 MatrixTools.setDenseMatrixFromTuple3d(spatialError, errorTranslationVector, 3, 0);
 return spatialError;
}
origin: us.ihmc/CommonWalkingControlModules

private void updateOrientationVisualization()
{
 desiredSpatialAcceleration.getAngularPart(desiredAngularAcceleration);
 yoDesiredAngularAcceleration.setAndMatchFrame(desiredAngularAcceleration);
 tempOrientation.setToZero(accelerationControlModule.getTrackingFrame());
 yoCurrentOrientation.setAndMatchFrame(tempOrientation);
 accelerationControlModule.getEndEffectorCurrentAngularVelocity(tempAngularVelocity);
 yoCurrentAngularVelocity.setAndMatchFrame(tempAngularVelocity);
 yoDesiredOrientation.get(tempAxisAngle);
 yoDesiredRotationVector.set(tempAxisAngle.getX(), tempAxisAngle.getY(), tempAxisAngle.getZ());
 yoDesiredRotationVector.scale(tempAxisAngle.getAngle());
 yoCurrentOrientation.get(tempAxisAngle);
 yoCurrentRotationVector.set(tempAxisAngle.getX(), tempAxisAngle.getY(), tempAxisAngle.getZ());
 yoCurrentRotationVector.scale(tempAxisAngle.getAngle());
}
origin: us.ihmc/DarpaRoboticsChallenge

public FrameVector computeDesiredAngularVelocity(FrameOrientation desiredOrientation, ReferenceFrame controlFrame, MutableDouble errorMagnitude)
{
 FrameVector ret = new FrameVector();
 errorFrameOrientation.setIncludingFrame(desiredOrientation);
 errorFrameOrientation.changeFrame(controlFrame);
 errorFrameOrientation.getAxisAngle(errorAxisAngle);
 errorRotation.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorRotation.scale(errorAxisAngle.getAngle());
 if (errorMagnitude != null)
   errorMagnitude.setValue(errorRotation.length());
 errorRotation.scale(1.0 / updateDT);
 ret.setIncludingFrame(controlFrame, errorRotation);
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

private void computeProportionalTerm(FrameOrientation desiredOrientation)
{
 desiredOrientation.changeFrame(bodyFrame);
 desiredOrientation.getQuaternion(errorQuaternion);
 errorAngleAxis.set(errorQuaternion);
 errorAngleAxis.setAngle(AngleTools.trimAngleMinusPiToPi(errorAngleAxis.getAngle()));
 // Limit the maximum position error considered for control action
 double maximumError = gains.getMaximumProportionalError();
 if (errorAngleAxis.getAngle() > maximumError)
 {
   errorAngleAxis.setAngle(Math.signum(errorAngleAxis.getAngle()) * maximumError);
 }
 proportionalTerm.set(errorAngleAxis.getX(), errorAngleAxis.getY(), errorAngleAxis.getZ());
 proportionalTerm.scale(errorAngleAxis.getAngle());
 rotationErrorInBody.set(proportionalTerm);
 proportionalGainMatrix.transform(proportionalTerm.getVector());
}
origin: us.ihmc/IHMCAvatarInterfaces

public FrameVector computeDesiredAngularVelocity(FrameOrientation desiredOrientation, ReferenceFrame controlFrame, MutableDouble errorMagnitude)
{
 FrameVector ret = new FrameVector();
 errorFrameOrientation.setIncludingFrame(desiredOrientation);
 errorFrameOrientation.changeFrame(controlFrame);
 errorFrameOrientation.getAxisAngle(errorAxisAngle);
 errorRotation.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorRotation.scale(AngleTools.trimAngleMinusPiToPi(errorAxisAngle.getAngle()));
 if (errorMagnitude != null)
   errorMagnitude.setValue(errorRotation.length());
 errorRotation.scale(1.0 / updateDT);
 ret.setIncludingFrame(controlFrame, errorRotation);
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

  public void update(Matrix3d rotationMatrix)
  {
   if (!hasBeenCalled.getBooleanValue())
   {
     orientationPreviousValue.set(rotationMatrix);
     hasBeenCalled.set(true);
   }

   if (rotationMatrix != currentOrientationMatrix)
     currentOrientationMatrix.set(rotationMatrix);
   orientationPreviousValue.get(previousOrientationMatrix);
   deltaOrientationMatrix.mulTransposeRight(currentOrientationMatrix, previousOrientationMatrix);
   deltaAxisAngle.set(deltaOrientationMatrix);

   set(deltaAxisAngle.getX(), deltaAxisAngle.getY(), deltaAxisAngle.getZ());
   scale(deltaAxisAngle.getAngle() / dt);

   orientationPreviousValue.set(currentOrientationMatrix);
  }
}
origin: us.ihmc/CommonWalkingControlModules

public double getNormRotationError(FrameOrientation desiredOrientation)
{
 tempOrientation.setIncludingFrame(desiredOrientation);
 tempOrientation.changeFrame(localControlFrame);
 tempOrientation.getAxisAngle(errorAxisAngle);
 errorRotationVector.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorRotationVector.scale(errorAxisAngle.getAngle());
 DenseMatrix64F selectionMatrix = inverseJacobianSolver.getSelectionMatrix();
 tempSpatialError.reshape(SpatialMotionVector.SIZE, 1);
 tempSubspaceError.reshape(selectionMatrix.getNumRows(), 1);
 MatrixTools.insertTuple3dIntoEJMLVector(errorRotationVector, tempSpatialError, 0);
 CommonOps.mult(selectionMatrix, tempSpatialError, tempSubspaceError);
 return NormOps.normP2(tempSubspaceError);
}
origin: us.ihmc/IHMCRoboticsToolkit

private void computeError(RigidBodyTransform desiredTransform)
{
 jacobian.compute();
 jacobian.getEndEffectorFrame().getTransformToDesiredFrame(actualTransform, jacobian.getBaseFrame());
 errorTransform.invert(desiredTransform);
 errorTransform.multiply(actualTransform);
 errorTransform.getRotation(errorRotationMatrix);
 RotationTools.convertMatrixToAxisAngle(errorRotationMatrix, errorAxisAngle);
 axis.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorRotationVector.set(axis);
 errorRotationVector.scale(errorAxisAngle.getAngle());
 errorRotationVector.scale(0.2);
 
 errorTransform.getTranslation(errorTranslationVector);
 
 MatrixTools.setDenseMatrixFromTuple3d(spatialError, errorRotationVector, 0, 0);
 MatrixTools.setDenseMatrixFromTuple3d(spatialError, errorTranslationVector, 3, 0);
}
origin: us.ihmc/IHMCAvatarInterfaces

public Twist computeDesiredTwist(FrameOrientation desiredOrientation, RigidBody endEffector, ReferenceFrame controlFrame, DenseMatrix64F selectionMatrix, MutableDouble errorMagnitude)
{
 errorFrameOrientation.setIncludingFrame(desiredOrientation);
 errorFrameOrientation.changeFrame(controlFrame);
 errorFrameOrientation.getAxisAngle(errorAxisAngle);
 errorRotation.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorRotation.scale(AngleTools.trimAngleMinusPiToPi(errorAxisAngle.getAngle()));
 ReferenceFrame endEffectorFrame = endEffector.getBodyFixedFrame();
 Twist desiredTwist = new Twist();
 desiredTwist.set(endEffectorFrame, elevatorFrame, controlFrame, new Vector3d(), errorRotation);
 desiredTwist.getMatrix(spatialError, 0);
 subspaceError.reshape(selectionMatrix.getNumRows(), 1);
 CommonOps.mult(selectionMatrix, spatialError, subspaceError);
 errorMagnitude.setValue(NormOps.normP2(subspaceError));
 desiredTwist.scale(1.0 / updateDT);
 return desiredTwist;
}
origin: us.ihmc/IHMCAvatarInterfaces

public Twist computeDesiredTwist(FramePose desiredPose, RigidBody endEffector, ReferenceFrame controlFrame, DenseMatrix64F selectionMatrix, MutableDouble errorMagnitude)
{
 errorFramePose.setIncludingFrame(desiredPose);
 errorFramePose.changeFrame(controlFrame);
 errorFramePose.getPosition(errorPosition);
 errorFramePose.getOrientation(errorAxisAngle);
 errorRotation.set(errorAxisAngle.getX(), errorAxisAngle.getY(), errorAxisAngle.getZ());
 errorRotation.scale(AngleTools.trimAngleMinusPiToPi(errorAxisAngle.getAngle()));
 ReferenceFrame endEffectorFrame = endEffector.getBodyFixedFrame();
 Twist desiredTwist = new Twist();
 desiredTwist.set(endEffectorFrame, elevatorFrame, controlFrame, errorPosition, errorRotation);
 desiredTwist.getMatrix(spatialError, 0);
 subspaceError.reshape(selectionMatrix.getNumRows(), 1);
 CommonOps.mult(selectionMatrix, spatialError, subspaceError);
 errorMagnitude.setValue(NormOps.normP2(subspaceError));
 desiredTwist.scale(1.0 / updateDT);
 return desiredTwist;
}
origin: us.ihmc/IHMCPerception

public static void rigidBodyTransformToOpenCVTR(RigidBodyTransform transform, Mat tvec, Mat rvec)
{
 Point3d translation = new Point3d();
 transform.getTranslation(translation);
 AxisAngle4d axisAngle = new AxisAngle4d();
 transform.getRotation(axisAngle);
 Vector3d rotVector = new Vector3d(axisAngle.getX(), axisAngle.getY(), axisAngle.getZ());
 rotVector.normalize();
 rotVector.scale(axisAngle.getAngle());
 tvec.put(0, 0, translation.getX());
 tvec.put(1, 0, translation.getY());
 tvec.put(2, 0, translation.getZ());
 rvec.put(0, 0, rotVector.getX());
 rvec.put(1, 0, rotVector.getY());
 rvec.put(2, 0, rotVector.getZ());
}
javax.vecmathAxisAngle4dgetX

Javadoc

Get value of x coordinate.

Popular methods of AxisAngle4d

  • <init>
    Constructs and initializes an AxisAngle4d from the components contained in the array.
  • getAngle
    Get the axis angle, in radians. An axis angle is a rotation angle about the vector (x,y,z).
  • set
    Sets the value of this axis angle to the specified x,y,z,angle.
  • getY
    Get value of y coordinate.
  • getZ
    Get value of z coordinate.
  • setAngle
    Set the axis angle, in radians. An axis angle is a rotation angle about the vector (x,y,z).
  • epsilonEquals
    Returns true if the L-infinite distance between this axis-angle and axis-angle a1 is less than or eq
  • setX
    Set a new value for x coordinate.
  • setY
    Set a new value for y coordinate.
  • setZ
    Set a new value for z coordinate.

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Collectors (java.util.stream)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now