本文整理了Java中us.ihmc.mecano.multiBodySystem.interfaces.JointBasics.getPredecessor()
方法的一些代码示例,展示了JointBasics.getPredecessor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JointBasics.getPredecessor()
方法的具体详情如下:
包路径:us.ihmc.mecano.multiBodySystem.interfaces.JointBasics
类名称:JointBasics
方法名:getPredecessor
暂无
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* 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 RigidBodyBasics getBase()
{
return joints[0].getPredecessor();
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
private static void checkJointOrder(JointBasics[] joints)
{
for (int i = 1; i < joints.length; i++)
{
JointBasics joint = joints[i];
JointBasics previousJoint = joints[i - 1];
if (MultiBodySystemTools.isAncestor(previousJoint.getPredecessor(), joint.getPredecessor()))
throw new RuntimeException("joints must be in order from ancestor to descendant");
}
}
代码示例来源:origin: us.ihmc/ihmc-robot-models
@Override
public void getOneDoFJointsFromRootToHere(OneDoFJointBasics oneDoFJointAtEndOfChain, List<OneDoFJointBasics> oneDoFJointsToPack)
{
oneDoFJointsToPack.clear();
JointBasics parent = oneDoFJointAtEndOfChain;
while (parent != rootJoint)
{
if (parent instanceof OneDoFJointBasics)
{
oneDoFJointsToPack.add((OneDoFJointBasics) parent);
}
parent = parent.getPredecessor().getParentJoint();
}
Collections.reverse(oneDoFJointsToPack);
}
代码示例来源:origin: us.ihmc/ihmc-robot-models
@Override public void getOneDoFJointsFromRootToHere(OneDoFJointBasics oneDoFJointAtEndOfChain, List<OneDoFJointBasics> oneDoFJointsToPack)
{
oneDoFJointsToPack.clear();
JointBasics parent = oneDoFJointAtEndOfChain;
while (parent != rootJoint)
{
if (parent instanceof OneDoFJointBasics)
{
oneDoFJointsToPack.add((OneDoFJointBasics) parent);
}
parent = parent.getPredecessor().getParentJoint();
}
Collections.reverse(oneDoFJointsToPack);
}
代码示例来源:origin: us.ihmc/mecano
/**
* Retrieves and gets the root body of the multi-body system the given {@code body} belongs to.
*
* @param body an arbitrary body that belongs to the multi-body system that this method is to find
* the root.
* @return the root body.
*/
public static RigidBodyBasics getRootBody(RigidBodyBasics body)
{
RigidBodyBasics root = body;
while (root.getParentJoint() != null)
{
root = root.getParentJoint().getPredecessor();
}
return root;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* Will return the {@code numberOfBodies}'eth parent of the provided {@code startBody}. E.g. if
* {@code numberOfBodies == 1} this will return the parent of the {@code startBody} and so on.
*
* @throws RuntimeException if the body chain is not long enough to reach the desired parent.
* @param startBody the body to start at.
* @param numberOfBodies the amount of steps to go up the body chain.
* @return the {@link RigidBodyBasics} that is {@code numberOfBodies} higher up the rigid body chain
* then the {@code startBody}.
*/
public static RigidBodyBasics goUpBodyChain(RigidBodyBasics startBody, int numberOfBodies)
{
if (numberOfBodies == 0)
{
return startBody;
}
JointBasics parentJoint = startBody.getParentJoint();
if (parentJoint == null)
{
throw new RuntimeException("Reached root body. Can not move up the chain any further.");
}
return goUpBodyChain(parentJoint.getPredecessor(), numberOfBodies - 1);
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
JointBasics parentJoint = currentBody.getParentJoint();
jointPathToPack[j] = parentJoint;
currentBody = parentJoint.getPredecessor();
i++;
代码示例来源:origin: us.ihmc/mecano
private RigidBody(String bodyName, JointBasics parentJoint, RigidBodyTransform inertiaPose)
{
if (bodyName == null)
throw new IllegalArgumentException("Name can not be null");
name = bodyName;
this.parentJoint = parentJoint;
ReferenceFrame frameAfterJoint = parentJoint.getFrameAfterJoint();
bodyFixedFrame = MovingReferenceFrame.constructFrameFixedInParent(bodyName + "CoM", frameAfterJoint, inertiaPose);
inertia = new SpatialInertia(bodyFixedFrame, bodyFixedFrame);
// inertia should be expressed in body frame, otherwise it will change
inertia.getBodyFrame().checkReferenceFrameMatch(inertia.getReferenceFrame());
parentJoint.setSuccessor(this);
nameId = parentJoint.getPredecessor().getNameId() + NAME_ID_SEPARATOR + bodyName;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
JointBasics parentJoint = joint.getPredecessor().getParentJoint();
if (parentJoint == null)
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
if (currentSCSJoint.getName().equals(idJoint.getPredecessor().getParentJoint().getName()))
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
RigidBodyBasics predecessor = parentJoint.getPredecessor();
TwistReadOnly twistOfPredecessor = computeOrGetTwistOfBody(predecessor);
twist = assignAndGetEmptyTwist(body);
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
String secondAnkleName = fullRobotModel.getFoot(robotSide).getParentJoint().getPredecessor().getParentJoint().getName();
if (simulatedRobot.getOneDegreeOfFreedomJoint(secondAnkleName) instanceof PinJoint)
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
String secondAnkleName = fullRobotModel.getFoot(robotSide).getParentJoint().getPredecessor().getParentJoint().getName();
if (simulatedRobot.getOneDegreeOfFreedomJoint(secondAnkleName) instanceof PinJoint)
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
String secondAnkleName = fullRobotModel.getFoot(robotSide).getParentJoint().getPredecessor().getParentJoint().getName();
simulatedRobot.getOneDegreeOfFreedomJoint(firstAnkleName).setDamping(ankleDamping);
simulatedRobot.getOneDegreeOfFreedomJoint(secondAnkleName).setDamping(ankleDamping);
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
String secondAnkleName = fullRobotModel.getFoot(robotSide).getParentJoint().getPredecessor().getParentJoint().getName();
simulatedRobot.getOneDegreeOfFreedomJoint(firstAnkleName).setDamping(ankleDamping);
simulatedRobot.getOneDegreeOfFreedomJoint(secondAnkleName).setDamping(ankleDamping);
内容来源于网络,如有侵权,请联系作者删除!