Tabnine Logo
InverseDynamicsJoint
Code IndexAdd Tabnine to your IDE (free)

How to use
InverseDynamicsJoint
in
us.ihmc.robotics.screwTheory

Best Java code snippets using us.ihmc.robotics.screwTheory.InverseDynamicsJoint (Showing top 20 results out of 315)

origin: us.ihmc/IHMCHumanoidRobotics

public ReferenceFrame getFrameAfterParentJoint()
{
 return ankle.getFrameAfterJoint();
}
origin: us.ihmc/IHMCPerception

private void addJoint(CollisionBoxProvider collissionBoxProvider, InverseDynamicsJoint joint)
{
 List<CollisionShape> collisionMesh = collissionBoxProvider.getCollisionMesh(joint.getName());
 if (collisionMesh != null)
 {
   trackingCollisionShapes.add(new TrackingCollisionShape(joint.getFrameAfterJoint(), collisionMesh));
 }
 else
 {
   System.err.println(joint + " does not have a collission mesh");
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Returns the end-effector {@code RigidBody} of this Jacobian.
* The end-effector is the successor of the last joint this Jacobian considers.
* 
* @return the end-effector of this jacobian.
*/
public RigidBody getEndEffector()
{
 return joints[joints.length - 1].getSuccessor();
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void getJointPositions(InverseDynamicsJoint[] joints, DenseMatrix64F jointPositionsToPack)
{
 int rowStart = 0;
 for (InverseDynamicsJoint joint : joints)
 {
   joint.getConfigurationMatrix(jointPositionsToPack, rowStart);
   rowStart += joint.getDegreesOfFreedom();
   if (joint instanceof SixDoFJoint || joint instanceof SphericalJoint)
    rowStart++; // Because of stupid quaternions
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void getJointVelocitiesMatrix(Iterable<? extends InverseDynamicsJoint> joints, DenseMatrix64F jointVelocitiesMatrixToPack)
{
 int rowStart = 0;
 for (InverseDynamicsJoint joint : joints)
 {
   int dof = joint.getDegreesOfFreedom();
   joint.getVelocityMatrix(jointVelocitiesMatrixToPack, rowStart);
   rowStart += dof;
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void setJointPositions(InverseDynamicsJoint[] joints, DenseMatrix64F jointPositions)
{
 int rowStart = 0;
 for (InverseDynamicsJoint joint : joints)
 {
   joint.setConfiguration(jointPositions, rowStart);
   rowStart += joint.getDegreesOfFreedom();
   if (joint instanceof SixDoFJoint || joint instanceof SphericalJoint)
    rowStart++; // Because of stupid quaternions
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

private void printJointInformation(InverseDynamicsJoint joint, StringBuffer buffer)
 String jointName = joint.getName();
 InverseDynamicsJoint parentJoint = joint.getPredecessor().getParentJoint();
 if (parentJoint == null)
   ReferenceFrame frameBeforeJoint = joint.getFrameBeforeJoint();
   ReferenceFrame frameAfterParentJoint = parentJoint.getFrameAfterJoint();
   RigidBodyTransform comOffsetTransform = frameBeforeJoint.getTransformToDesiredFrame(frameAfterParentJoint);
   comOffsetTransform.getTranslation(jointOffset);
 RigidBody linkRigidBody = joint.getSuccessor();
 printLinkInformation(linkRigidBody, buffer);
origin: us.ihmc/IHMCRoboticsToolkit

  private static final void areJointsTheSame(InverseDynamicsJoint originalJoint, InverseDynamicsJoint targetJoint)
  {
   if(!(originalJoint.getClass().equals(targetJoint.getClass()) && 
      originalJoint.getName().equals(targetJoint.getName())))
   {
     throw new RuntimeException(originalJoint.getName() + " differs from " + targetJoint);
   }
   
  }
}
origin: us.ihmc/IHMCRoboticsToolkit

private void storeJointState()
{
 ScrewTools.getDesiredJointAccelerationsMatrix(jointsInOrder, storedJointDesiredAccelerations);
 ScrewTools.getJointVelocitiesMatrix(jointsInOrder, storedJointVelocities);
 for (InverseDynamicsJoint joint : jointsInOrder)
 {
   DenseMatrix64F tauMatrix = new DenseMatrix64F(joint.getDegreesOfFreedom(), 1);
   joint.getTauMatrix(tauMatrix);
   DenseMatrix64F spatialForce = new DenseMatrix64F(SpatialForceVector.SIZE, 1);
   CommonOps.mult(joint.getMotionSubspace().getJacobianMatrix(), tauMatrix, spatialForce);
   Wrench jointWrench = storedJointWrenches.get(joint);
   jointWrench.set(joint.getFrameAfterJoint(), spatialForce);
   jointWrench.changeFrame(joint.getSuccessor().getBodyFixedFrame());
 }
}
origin: us.ihmc/DarpaRoboticsChallenge

public ForceSensorToJointTorqueProjector(String namePrefix, ForceSensorData forceSensorData, RigidBody sensorLinkBody) 
{
 registry = new YoVariableRegistry(namePrefix+getClass().getSimpleName());
 this.forceSensorData = forceSensorData;
 //ground reaction wrench on joints
 yoTorqueInJoints = new ArrayList<>();
 RigidBody currentBody = sensorLinkBody;
 for(int i=0;i<numberOfJointFromSensor;i++)
 {
   FrameVector jAxis = ((OneDoFJoint)currentBody.getParentJoint()).getJointAxis();
   yoTorqueInJoints.add(new ImmutablePair<>(jAxis,new DoubleYoVariable("NegGRFWrenchIn"+ currentBody.getParentJoint().getName(), registry)));
   currentBody=currentBody.getParentJoint().getPredecessor();
 }
}
@Override
origin: us.ihmc/IHMCRoboticsToolkit

if (currentBody == joint.getPredecessor())
 joint.getPredecessorTwist(jointTwist);
 currentBody = joint.getSuccessor();
else if (currentBody == joint.getSuccessor())
 joint.getSuccessorTwist(jointTwist);
 currentBody = joint.getPredecessor();
origin: us.ihmc/IHMCRoboticsToolkit

private void computeSuccessorAcceleration(InverseDynamicsJoint joint)
{
 RigidBody predecessor = joint.getPredecessor();
 RigidBody successor = joint.getSuccessor();
 ReferenceFrame successorFrame = successor.getBodyFixedFrame();
 joint.getPredecessorTwist(tempJointTwist);
 if (!doVelocityTerms)
   tempJointTwist.setToZero();
 if (useDesireds)
   joint.getDesiredSuccessorAcceleration(tempJointAcceleration);
 else
   joint.getSuccessorAcceleration(tempJointAcceleration);
 if (!doAccelerationTerms)
   tempJointAcceleration.setToZero();
 twistCalculator.getTwistOfBody(tempTwistFromWorld, predecessor);
 if (!doVelocityTerms)
   tempTwistFromWorld.setToZero();
 SpatialAccelerationVector successorAcceleration = accelerations.get(successor);
 successorAcceleration.set(accelerations.get(predecessor));
 successorAcceleration.changeFrame(successorFrame, tempJointTwist, tempTwistFromWorld);
 successorAcceleration.add(tempJointAcceleration);
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Returns the base {@code RigidBody} of this Jacobian.
* The base is the predecessor of the first joint that this Jacobian considers.
* 
* @return the base of this Jacobian.
*/
public RigidBody getBase()
{
 return joints[0].getPredecessor();
}
origin: us.ihmc/IHMCRoboticsToolkit

public static RigidBody[] computeSubtreeSuccessors(InverseDynamicsJoint... joints)
{
 ArrayList<RigidBody> rigidBodySuccessors = new ArrayList<RigidBody>();
 ArrayList<RigidBody> rigidBodyStack = new ArrayList<RigidBody>();
 for (InverseDynamicsJoint joint : joints)
 {
   rigidBodyStack.add(joint.getPredecessor());
 }
 while (!rigidBodyStack.isEmpty())
 {
   RigidBody currentBody = rigidBodyStack.remove(0);
   List<InverseDynamicsJoint> childrenJoints = currentBody.getChildrenJoints();
   for (InverseDynamicsJoint joint : childrenJoints)
   {
    rigidBodyStack.add(joint.getSuccessor());
    rigidBodySuccessors.add(joint.getSuccessor());
   }
 }
 RigidBody[] ret = new RigidBody[rigidBodySuccessors.size()];
 return rigidBodySuccessors.toArray(ret);
}
origin: us.ihmc/IHMCRoboticsToolkit

public static int computeDegreesOfFreedom(InverseDynamicsJoint[] jointList)
{
 int ret = 0;
 for (InverseDynamicsJoint joint : jointList)
 {
   ret += joint.getDegreesOfFreedom();
 }
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

public void compute()
{
 int column = 0;
 for (int i = 0; i < rigidBodyList.size(); i++)
 {
   comScaledByMassMapIsUpdated.get(rigidBodyList.get(i)).setValue(false);
 }
 
 for (InverseDynamicsJoint joint : joints)
 {
   RigidBody childBody = joint.getSuccessor();
      FramePoint comPositionScaledByMass = getCoMScaledByMass(childBody);
   double subTreeMass = getSubTreeMass(childBody);
   GeometricJacobian motionSubspace = joint.getMotionSubspace();
   final List<Twist> allTwists = motionSubspace.getAllUnitTwists();
   for(int i = 0; i <  allTwists.size(); i++)
   {
    tempUnitTwist.set(allTwists.get(i));
    tempUnitTwist.changeFrame(rootFrame);
    setColumn(tempUnitTwist, comPositionScaledByMass, subTreeMass, column);
    column++;
   }
 }
 
 CommonOps.scale(inverseTotalMass, jacobianMatrix);
}
origin: us.ihmc/IHMCRoboticsToolkit

private void computeJointWrenchesAndTorques()
{
 for (int jointIndex = allJoints.size() - 1; jointIndex >= 0; jointIndex--)
 {
   InverseDynamicsJoint joint = allJoints.get(jointIndex);
   RigidBody successor = joint.getSuccessor();
   Wrench jointWrench = jointWrenches.get(joint);
   jointWrench.set(netWrenches.get(successor));
   Wrench externalWrench = externalWrenches.get(successor);
   jointWrench.sub(externalWrench);
   List<InverseDynamicsJoint> childrenJoints = successor.getChildrenJoints();
   for (int childIndex = 0; childIndex < childrenJoints.size(); childIndex++)
   {
    InverseDynamicsJoint child = childrenJoints.get(childIndex);
    if (!jointsToIgnore.contains(child))
    {
      Wrench wrenchExertedOnChild = jointWrenches.get(child);
      ReferenceFrame successorFrame = successor.getBodyFixedFrame();
      wrenchExertedByChild.set(wrenchExertedOnChild);
      wrenchExertedByChild.changeBodyFrameAttachedToSameBody(successorFrame);
      wrenchExertedByChild.scale(-1.0); // Action = -reaction
      wrenchExertedByChild.changeFrame(jointWrench.getExpressedInFrame());
      jointWrench.sub(wrenchExertedByChild);
    }
   }
   joint.setTorqueFromWrench(jointWrench);
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

private void setDesiredAccelerationsToZero()
{
 for (InverseDynamicsJoint joint : jointsInOrder)
 {
   joint.setDesiredAccelerationToZero();
   joint.setVelocity(new DenseMatrix64F(joint.getDegreesOfFreedom(), 1), 0);
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void setVelocities(InverseDynamicsJoint[] jointList, DenseMatrix64F jointVelocities)
{
 int rowStart = 0;
 for (InverseDynamicsJoint joint : jointList)
 {
   joint.setVelocity(jointVelocities, rowStart);
   rowStart += joint.getDegreesOfFreedom();
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void getDesiredJointAccelerationsMatrix(InverseDynamicsJoint[] joints, DenseMatrix64F desiredJointAccelerationsMatrixToPack)
{
 int rowStart = 0;
 for (InverseDynamicsJoint joint : joints)
 {
   int dof = joint.getDegreesOfFreedom();
   joint.getDesiredAccelerationMatrix(desiredJointAccelerationsMatrixToPack, rowStart);
   rowStart += dof;
 }
}
us.ihmc.robotics.screwTheoryInverseDynamicsJoint

Javadoc

Base interface that describes the basic API for the joints composing a kinematic chain/tree compatible with the screw theory. Here are a few examples of useful screw tools:
  • The GeometricJacobian can compute the Jacobian matrix of a kinematic chain.
  • The TwistCalculator can compute all the Twist(angular and linear velocity) of all the RigidBodys of a kinematic chain/tree.
  • Similar to the TwistCalculator, the SpatialAccelerationCalculatorcan compute all the spatial accelerations of all the RigidBodys of a kinematic chain/tree.
  • Based on the recursive Newton-Euler algorithm, the InverseDynamicsCalculator computes the desired joint torques tau from the joint configurations q, velocities qd, desired accelerations qddDesired, and the list of external Wrenches applied on the system.
  • Other tools such as CentroidalMomentumMatrix, ConvectiveTermCalculator, CentroidalMomentumRateTermCalculator, are useful tools for developing whole-body control framework.

Most used methods

  • getFrameAfterJoint
  • getName
    Returns the reference to the name of this joint.
  • getSuccessor
    Returns the RigidBody that succeeds this joint. In other words, the RigidBody directly connected to
  • getPredecessor
    Returns the RigidBody that precedes this joint. In other words, the RigidBody directly connected to
  • getConfigurationMatrix
    Packs this joint's configuration into a column vector DenseMatrix64F. Here are a few examples: * Fo
  • getDegreesOfFreedom
    Returns the number of degrees of freedom that this joint has.
  • getFrameBeforeJoint
    Returns the the ReferenceFrame that is attached to the predecessor of this joint, namely the RigidBo
  • setConfiguration
    Sets the joint current configuration from the given column vector DenseMatrix64F. Here are a few exa
  • calculateJointDesiredChecksum
  • calculateJointStateChecksum
  • getConfigurationMatrixSize
    In most cases, this is the same as #getDegreesOfFreedom(). However, for SixDoFJoint and SphericalJoi
  • getDesiredAccelerationMatrix
    Packs this joint desired acceleration into a column vector DenseMatrix64F. Here are a few examples:
  • getConfigurationMatrixSize,
  • getDesiredAccelerationMatrix,
  • getDesiredSuccessorAcceleration,
  • getMotionSubspace,
  • getPredecessorTwist,
  • getSuccessorAcceleration,
  • getSuccessorTwist,
  • getTauMatrix,
  • getVelocityMatrix,
  • setDesiredAcceleration

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • String (java.lang)
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now