Search in sources :

Example 26 with TransformNR

use of com.neuronrobotics.sdk.addons.kinematics.math.TransformNR in project java-bowler by NeuronRobotics.

the class AbstractKinematicsNR method getCurrentTaskSpaceTransform.

/**
 * This takes a reading of the robots position and converts it to a joint space vector
 * This vector is converted to task space and returned
 * @return taskSpaceVector in mm,radians [x,y,z,rotx,rotY,rotZ]
 */
public TransformNR getCurrentTaskSpaceTransform() {
    TransformNR fwd = forwardKinematics(getCurrentJointSpaceVector());
    if (fwd == null)
        throw new RuntimeException("Implementations of the kinematics need to return a transform not null");
    // Log.info("Getting robot task space "+fwd);
    TransformNR taskSpaceTransform = forwardOffset(fwd);
    // Log.info("Getting global task space "+taskSpaceTransform);
    return taskSpaceTransform;
}
Also used : TransformNR(com.neuronrobotics.sdk.addons.kinematics.math.TransformNR)

Example 27 with TransformNR

use of com.neuronrobotics.sdk.addons.kinematics.math.TransformNR in project java-bowler by NeuronRobotics.

the class AbstractKinematicsNR method inverseOffset.

protected TransformNR inverseOffset(TransformNR t) {
    // System.out.println("RobotToFiducialTransform "+getRobotToFiducialTransform());
    // System.out.println("FiducialToRASTransform "+getFiducialToRASTransform());
    Matrix rtz = getFiducialToGlobalTransform().getMatrixTransform().inverse();
    Matrix ztr = getRobotToFiducialTransform().getMatrixTransform().inverse();
    Matrix current = t.getMatrixTransform();
    Matrix mForward = ztr.times(rtz).times(current);
    return new TransformNR(mForward);
}
Also used : Matrix(Jama.Matrix) TransformNR(com.neuronrobotics.sdk.addons.kinematics.math.TransformNR)

Example 28 with TransformNR

use of com.neuronrobotics.sdk.addons.kinematics.math.TransformNR in project java-bowler by NeuronRobotics.

the class AbstractKinematicsNR method setBaseToZframeTransform.

public void setBaseToZframeTransform(TransformNR baseToFiducial) {
    Log.info("Setting Fiducial To base Transform " + baseToFiducial);
    this.base2Fiducial = baseToFiducial;
    for (IRegistrationListenerNR r : regListeners) {
        r.onBaseToFiducialUpdate(this, baseToFiducial);
    }
    Platform.runLater(new Runnable() {

        @Override
        public void run() {
            TransformFactory.getTransform(forwardOffset(new TransformNR()), root);
        }
    });
}
Also used : TransformNR(com.neuronrobotics.sdk.addons.kinematics.math.TransformNR)

Example 29 with TransformNR

use of com.neuronrobotics.sdk.addons.kinematics.math.TransformNR in project java-bowler by NeuronRobotics.

the class CartesianNamespacePidKinematics method setDesiredJointSpaceVector.

/**
 * This calculates the target pose
 * @param JointSpaceVector the target joint space vector
 * @param seconds the time for the transition to take from current position to target, unit seconds
 * @return The joint space vector is returned for target arrival referance
 * @throws Exception If there is a workspace error
 */
@Override
public double[] setDesiredJointSpaceVector(double[] jointSpaceVect, double seconds) throws Exception {
    if (jointSpaceVect.length != getNumberOfLinks()) {
        throw new IndexOutOfBoundsException("Vector must be " + getNumberOfLinks() + " links, actual number of links = " + jointSpaceVect.length);
    }
    factory.setCachedTargets(jointSpaceVect);
    currentJointSpaceTarget = jointSpaceVect;
    TransformNR fwd = connection.setDesiredJointSpaceVector(jointSpaceVect, seconds);
    fireTargetJointsUpdate(currentJointSpaceTarget, fwd);
    return jointSpaceVect;
}
Also used : TransformNR(com.neuronrobotics.sdk.addons.kinematics.math.TransformNR)

Example 30 with TransformNR

use of com.neuronrobotics.sdk.addons.kinematics.math.TransformNR in project java-bowler by NeuronRobotics.

the class CartesianNamespacePidKinematics method getCurrentTaskSpaceTransform.

/**
 * This takes a reading of the robots position and converts it to a joint space vector
 * This vector is converted to task space and returned
 * @return taskSpaceVector in mm,radians [x,y,z,rotx,rotY,rotZ]
 */
@Override
public TransformNR getCurrentTaskSpaceTransform() {
    // TransformNR fwd  = forwardKinematics(getCurrentJointSpaceVector());
    TransformNR fwd = connection.getCurrentTaskSpaceTransform();
    // update the joint space
    getCurrentJointSpaceVector();
    // Log.info("Getting robot task space "+fwd);
    TransformNR taskSpaceTransform = forwardOffset(fwd);
    // Log.info("Getting global task space "+taskSpaceTransform);
    return taskSpaceTransform;
}
Also used : TransformNR(com.neuronrobotics.sdk.addons.kinematics.math.TransformNR)

Aggregations

TransformNR (com.neuronrobotics.sdk.addons.kinematics.math.TransformNR)43 RotationNR (com.neuronrobotics.sdk.addons.kinematics.math.RotationNR)13 Matrix (Jama.Matrix)6 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)4 Affine (javafx.scene.transform.Affine)4 RuntimeErrorException (javax.management.RuntimeErrorException)4 InvalidConnectionException (com.neuronrobotics.sdk.common.InvalidConnectionException)3 CSG (eu.mihosoft.vrl.v3d.CSG)3 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)3 ParallelGroup (com.neuronrobotics.sdk.addons.kinematics.parallel.ParallelGroup)2 File (java.io.File)2 Group (javafx.scene.Group)2 Quat4f (javax.vecmath.Quat4f)2 Vector3f (javax.vecmath.Vector3f)2 InvalidRemoteException (org.eclipse.jgit.api.errors.InvalidRemoteException)2 TransportException (org.eclipse.jgit.api.errors.TransportException)2 Transform (com.bulletphysics.linearmath.Transform)1 IssueReportingExceptionHandler (com.neuronrobotics.bowlerstudio.IssueReportingExceptionHandler)1 CodeHandler (com.neuronrobotics.replicator.driver.interpreter.CodeHandler)1