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

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

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

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

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

private static void checkJointOrder(InverseDynamicsJoint[] joints)
{
 for (int i = 1; i < joints.length; i++)
 {
   InverseDynamicsJoint joint = joints[i];
   InverseDynamicsJoint previousJoint = joints[i - 1];
   if (ScrewTools.isAncestor(previousJoint.getPredecessor(), joint.getPredecessor()))
    throw new RuntimeException("joints must be in order from ancestor to descendant");
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

public void computeJacobianDerivativeTerm(SpatialAccelerationVector accelerationToPack)
{
 ReferenceFrame endEffectorFrame = jacobian.getEndEffectorFrame();
 twistOfCurrentWithRespectToBase.setToZero(endEffectorFrame, endEffectorFrame, endEffectorFrame);
 accelerationToPack.setToZero(endEffectorFrame, endEffectorFrame, endEffectorFrame);
 RigidBody currentBody = jacobian.getEndEffector();
 for (int i = jacobian.getJointsInOrder().length - 1; i >= 0; i--)
 {
   twistOfCurrentWithRespectToBase.changeFrame(currentBody.getBodyFixedFrame());
   InverseDynamicsJoint joint = jacobian.getJointsInOrder()[i];
   if (currentBody == joint.getPredecessor())
   {
    joint.getPredecessorTwist(jointTwist);
    currentBody = joint.getSuccessor();
   }
   else
   {
    joint.getSuccessorTwist(jointTwist);
    currentBody = joint.getPredecessor();            
   }
   zeroAcceleration.setToZero(jointTwist.getBodyFrame(), jointTwist.getBaseFrame(), jointTwist.getExpressedInFrame());
   zeroAcceleration.changeFrame(endEffectorFrame, twistOfCurrentWithRespectToBase, jointTwist);
   zeroAcceleration.add(accelerationToPack);
   accelerationToPack.set(zeroAcceleration);
   jointTwist.invert();
   twistOfCurrentWithRespectToBase.add(jointTwist);
 }
 accelerationToPack.changeBodyFrameNoRelativeAcceleration(endEffectorFrame);
}
origin: us.ihmc/IHMCRoboticsToolkit

private RigidBody addAllPrecedingJoints(RigidBody body)
{
 ArrayList<InverseDynamicsJoint> jointsTillRootBody = new ArrayList<InverseDynamicsJoint>();
 RigidBody currentBody = body;
 while (currentBody.getParentJoint() != null)
 {
   jointsTillRootBody.add(currentBody.getParentJoint());
   currentBody = currentBody.getParentJoint().getPredecessor();
 }
 for (int i = jointsTillRootBody.size() - 1; i >= 0; i--)
 {
   allJoints.add(jointsTillRootBody.get(i));
 }
 return currentBody;
}
origin: us.ihmc/IHMCRoboticsToolkit

if (currentBody == joint.getPredecessor())
 currentBody = joint.getPredecessor();
origin: us.ihmc/IHMCRoboticsToolkit

public static boolean isAncestor(RigidBody candidateDescendant, RigidBody ancestor)
{
 RigidBody currentBody = candidateDescendant;
 while (!currentBody.isRootBody())
 {
   if (currentBody == ancestor)
   {
    return true;
   }
   currentBody = currentBody.getParentJoint().getPredecessor();
 }
 return currentBody == ancestor;
}
origin: us.ihmc/IHMCRoboticsToolkit

public static RigidBody getRootBody(RigidBody body)
{
 RigidBody ret = body;
 while (ret.getParentJoint() != null)
 {
   ret = ret.getParentJoint().getPredecessor();
 }
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

public static int computeDistanceToAncestor(RigidBody descendant, RigidBody ancestor)
{
 int ret = 0;
 RigidBody currentBody = descendant;
 while (!currentBody.isRootBody() && (currentBody != ancestor))
 {
   ret++;
   currentBody = currentBody.getParentJoint().getPredecessor();
 }
 if (currentBody != ancestor)
   ret = -1;
 return ret;
}
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[] createParentMap(RigidBody[] allRigidBodiesInOrder)
{
 int[] parentMap = new int[allRigidBodiesInOrder.length];
 List<RigidBody> rigidBodiesInOrderList = Arrays.asList(allRigidBodiesInOrder); // this doesn't have to be fast
 for (int i = 0; i < allRigidBodiesInOrder.length; i++)
 {
   RigidBody currentBody = allRigidBodiesInOrder[i];
   if (currentBody.isRootBody())
   {
    parentMap[i] = -1;
   }
   else
   {
    RigidBody parentBody = currentBody.getParentJoint().getPredecessor();
    parentMap[i] = rigidBodiesInOrderList.indexOf(parentBody);
   }
 }
 return parentMap;
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void computeRigidBodiesFromRootToThisJoint(ArrayList<RigidBody> rigidBodySuccessorsToPack, InverseDynamicsJoint joint)
{
 RigidBody predecessorBody = joint.getPredecessor();
 if (predecessorBody == null)
   return;
 if (predecessorBody.isRootBody())
   return;
 rigidBodySuccessorsToPack.add(predecessorBody);
 InverseDynamicsJoint parentJoint = predecessorBody.getParentJoint();
 if (parentJoint == null)
   return;
 computeRigidBodiesFromRootToThisJoint(rigidBodySuccessorsToPack, parentJoint);
}
origin: us.ihmc/CommonWalkingControlModules

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/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

public static InverseDynamicsJoint[] createJointPath(RigidBody start, RigidBody end)
{
 boolean flip = false;
 RigidBody descendant = start;
 RigidBody ancestor = end;
 int pathLength = computeDistanceToAncestor(descendant, ancestor);
 if (pathLength < 0)
 {
   flip = true;
   descendant = end;
   ancestor = start;
   pathLength = computeDistanceToAncestor(end, start);
 }
 InverseDynamicsJoint[] ret = new InverseDynamicsJoint[pathLength];
 RigidBody currentBody = descendant;
 int i = 0;
 while (currentBody != ancestor)
 {
   int j = flip ? pathLength - 1 - i : i;
   InverseDynamicsJoint parentJoint = currentBody.getParentJoint();
   ret[j] = parentJoint;
   currentBody = parentJoint.getPredecessor();
   i++;
 }
 return ret;
}
origin: us.ihmc/IHMCRoboticsToolkit

InverseDynamicsJoint parentJoint = currentBody.getParentJoint();
jointPathToPack[j] = parentJoint;
currentBody = parentJoint.getPredecessor();
i++;
origin: us.ihmc/IHMCRoboticsToolkit

InverseDynamicsJoint parentJoint = joint.getPredecessor().getParentJoint();
if (parentJoint == null)
origin: us.ihmc/IHMCRoboticsToolkit

RigidBody predecessor = parentJoint.getPredecessor();
Twist twistOfPredecessor = computeOrGetTwistOfBody(predecessor);
twist = assignAndGetEmptyTwist(rigidBody);
us.ihmc.robotics.screwTheoryInverseDynamicsJointgetPredecessor

Javadoc

Returns the RigidBody that precedes this joint. In other words, the RigidBody directly connected to this joint that sits between this joint and the root or that is the root of this kinematics chain.

Popular methods of InverseDynamicsJoint

  • 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
  • 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:
  • getDesiredSuccessorAcceleration
    Packs the SpatialAccelerationVector (the 3D angular and linear accelerations) of this joint's succes
  • getDesiredAccelerationMatrix,
  • getDesiredSuccessorAcceleration,
  • getMotionSubspace,
  • getPredecessorTwist,
  • getSuccessorAcceleration,
  • getSuccessorTwist,
  • getTauMatrix,
  • getVelocityMatrix,
  • setDesiredAcceleration

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
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