gpt4 book ai didi

us.ihmc.mecano.spatial.Wrench.setIncludingFrame()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 13:43:05 25 4
gpt4 key购买 nike

本文整理了Java中us.ihmc.mecano.spatial.Wrench.setIncludingFrame()方法的一些代码示例,展示了Wrench.setIncludingFrame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrench.setIncludingFrame()方法的具体详情如下:
包路径:us.ihmc.mecano.spatial.Wrench
类名称:Wrench
方法名:setIncludingFrame

Wrench.setIncludingFrame介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/mecano

/**
* Copy constructor.
*
* @param other the other wrench to copy. Not modified.
*/
public Wrench(WrenchReadOnly other)
{
 setIncludingFrame(other);
}

代码示例来源:origin: us.ihmc/mecano

/**
* Creates a new wrench and initializes its components and reference frames.
*
* @param bodyFrame the frame rigidly attached to the body on which this wrench is applied.
* @param expressedInFrame the frame in which this wrench is expressed.
* @param angularPart the vector holding the values for the angular part. Not modified.
* @param linearPart the vector holding the values for the linear part. Not modified.
*/
public Wrench(ReferenceFrame bodyFrame, ReferenceFrame expressedInFrame, Vector3DReadOnly angularPart, Vector3DReadOnly linearPart)
{
 setIncludingFrame(bodyFrame, expressedInFrame, angularPart, linearPart);
}

代码示例来源:origin: us.ihmc/mecano

/**
* Creates a new wrench from the given reference frames and array.
* <p>
* The components are read in the following order: {@code angularPartX}, {@code angularPartY},
* {@code angularPartZ}, {@code linearPartX}, {@code linearPartY}, {@code linearPartZ}.
* </p>
*
* @param bodyFrame the frame rigidly attached to the body on which this wrench is applied.
* @param expressedInFrame the frame in which this wrench is expressed.
* @param array the array containing the new values for this vector's components. Not modified.
*/
public Wrench(ReferenceFrame bodyFrame, ReferenceFrame expressedInFrame, double[] array)
{
 setIncludingFrame(bodyFrame, expressedInFrame, array);
}

代码示例来源:origin: us.ihmc/mecano

/**
* Creates a new wrench from the given reference frames and matrix.
* <p>
* The components are read in the following order: {@code angularPartX}, {@code angularPartY},
* {@code angularPartZ}, {@code linearPartX}, {@code linearPartY}, {@code linearPartZ}.
* </p>
*
* @param bodyFrame the frame rigidly attached to the body on which this wrench is applied.
* @param expressedInFrame the frame in which this wrench is expressed.
* @param matrix the column vector containing the values for this vector's components. Not
*           modified.
*/
public Wrench(ReferenceFrame bodyFrame, ReferenceFrame expressedInFrame, DenseMatrix64F matrix)
{
 setIncludingFrame(bodyFrame, expressedInFrame, matrix);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public void setExternalWrench(RigidBodyBasics rigidBody, WrenchReadOnly externalWrench)
{
 externalWrenches.get(rigidBody).setIncludingFrame(externalWrench);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

@Override
public void getWrench(Wrench wrenchToPack)
{
 wrenchToPack.setBodyFrame(measurementFrame);
 wrenchToPack.setIncludingFrame(measurementFrame, wrench);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public void computeTotalWrench(Wrench totalGroundReactionWrenchToPack, Collection<? extends WrenchReadOnly> wrenches, ReferenceFrame referenceFrame)
  {
   totalGroundReactionWrenchToPack.setToZero(referenceFrame, referenceFrame);

   for (WrenchReadOnly wrench : wrenches)
   {
     temporaryWrench.setIncludingFrame(wrench);
     temporaryWrench.changeFrame(referenceFrame);
     temporaryWrench.setBodyFrame(referenceFrame);
     totalGroundReactionWrenchToPack.add(temporaryWrench);
   }
  }
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

jointWrench.setIncludingFrame(netWrenches.get(successor));
   ReferenceFrame successorFrame = successor.getBodyFixedFrame();
   wrenchExertedByChild.setIncludingFrame(wrenchExertedOnChild);
   wrenchExertedByChild.setBodyFrame(successorFrame);
   wrenchExertedByChild.scale(-1.0); // Action = -reaction

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

public Map<RigidBodyBasics, Wrench> computeWrenches(LinkedHashMap<RigidBodyBasics, ? extends PlaneContactState> contactStates, DenseMatrix64F rho)
  {
   wrenches.clear();
   int columnNumber = 0;
   for (RigidBodyBasics rigidBody : contactStates.keySet())
   {
     PlaneContactState contactState = contactStates.get(rigidBody);

     int nColumns = contactState.getNumberOfContactPointsInContact() * normalizedSupportVectors.size();
     if (nColumns > 0)
     {
      qBlock.reshape(Wrench.SIZE, nColumns);
      CommonOps.extract(q, 0, Wrench.SIZE, columnNumber, columnNumber + nColumns, qBlock, 0, 0);

      rhoBlock.reshape(nColumns, 1);
      CommonOps.extract(rho, columnNumber, columnNumber + nColumns, 0, 1, rhoBlock, 0, 0);

      CommonOps.mult(qBlock, rhoBlock, wrenchMatrix);

      Wrench wrench = new Wrench(rigidBody.getBodyFixedFrame(), centerOfMassFrame);
      wrench.setIncludingFrame(centerOfMassFrame, wrenchMatrix);
      wrench.changeFrame(rigidBody.getBodyFixedFrame());
      wrenches.put(rigidBody, wrench);
      columnNumber += nColumns;
     }
   }
   return wrenches;
  }
}

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

public static void assertRootJointWrenchZero(Map<RigidBodyBasics, Wrench> externalWrenches, SixDoFJoint rootJoint, double gravityZ, double epsilon)
  {
   InverseDynamicsCalculator inverseDynamicsCalculator = new InverseDynamicsCalculator(rootJoint.getPredecessor());
   inverseDynamicsCalculator.setGravitionalAcceleration(-gravityZ);
   for (RigidBodyBasics rigidBody : externalWrenches.keySet())
   {
     Wrench externalWrench = externalWrenches.get(rigidBody);
     externalWrench.changeFrame(rigidBody.getBodyFixedFrame());
     inverseDynamicsCalculator.setExternalWrench(rigidBody, externalWrench);
   }
   inverseDynamicsCalculator.compute();
   Wrench wrench = new Wrench();
   wrench.setIncludingFrame(rootJoint.getJointWrench());

   SpatialForce zeroWrench = new SpatialForce(wrench.getReferenceFrame());
   MecanoTestTools.assertSpatialForceEquals(wrench, zeroWrench, epsilon);
  }
}

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

for (int i = 0; i < endEffectors.size(); i++)
 desiredWrench.setIncludingFrame(yoDesiredWrenches.get(i));
 virtualModelController.submitControlledBodyVirtualWrench(endEffectors.get(i), desiredWrench, selectionMatrix);

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

public static void assertWrenchesSumUpToMomentumDot(Collection<Wrench> externalWrenches, SpatialForce desiredCentroidalMomentumRate, double gravityZ,
   double mass, ReferenceFrame centerOfMassFrame, double epsilon)
{
 SpatialForce totalWrench = new SpatialForce(centerOfMassFrame);
 Wrench tempWrench = new Wrench();
 for (Wrench wrench : externalWrenches)
 {
   tempWrench.setIncludingFrame(wrench);
   tempWrench.changeFrame(centerOfMassFrame);
   totalWrench.add(tempWrench);
 }
 Wrench gravitationalWrench = new Wrench(centerOfMassFrame, centerOfMassFrame);
 gravitationalWrench.setLinearPartZ(-mass * gravityZ);
 totalWrench.add(gravitationalWrench);
 MecanoTestTools.assertSpatialForceEquals(desiredCentroidalMomentumRate, totalWrench, epsilon);
}

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

for (int i = 0; i < endEffectors.size(); i++)
 desiredWrench.setIncludingFrame(yoDesiredWrenches.get(i));
 virtualModelController.addExternalWrench(controllerModel.getRootBody(), endEffectors.get(i), desiredWrench, selectionMatrix);

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

private void storeJointState()
{
 MultiBodySystemTools.extractJointsState(jointsInOrder, JointStateType.ACCELERATION, storedJointDesiredAccelerations);
 MultiBodySystemTools.extractJointsState(jointsInOrder, JointStateType.VELOCITY, storedJointVelocities);
 for (JointBasics joint : jointsInOrder)
 {
   DenseMatrix64F tauMatrix = new DenseMatrix64F(joint.getDegreesOfFreedom(), 1);
   joint.getJointTau(0, tauMatrix);
   DenseMatrix64F spatialForce = new DenseMatrix64F(SpatialForce.SIZE, 1);
   DenseMatrix64F motionSubspace = new DenseMatrix64F(6, joint.getDegreesOfFreedom());
   joint.getMotionSubspace(motionSubspace);
   CommonOps.mult(motionSubspace, tauMatrix, spatialForce);
   Wrench jointWrench = storedJointWrenches.get(joint);
   jointWrench.setIncludingFrame(joint.getFrameAfterJoint(), spatialForce);
   jointWrench.changeFrame(joint.getFrameAfterJoint());
 }
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

rootJointWrench.setIncludingFrame(rootJoint.getJointWrench());

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

outputWrench.setIncludingFrame(rootInverseDynamicsJoint.getJointWrench());

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

public void setRobotTorquesToMatchFullRobotModel()
{
 FloatingJointBasics rootJoint = fullRobotModel.getRootJoint();
 ReferenceFrame bodyFixedFrame = fullRobotModel.getPelvis().getBodyFixedFrame();
 Wrench rootJointWrench = new Wrench(bodyFixedFrame, bodyFixedFrame);
 rootJointWrench.setIncludingFrame(rootJoint.getJointWrench());
 rootJointWrench.changeFrame(bodyFixedFrame);
 FrameVector3D rootJointForce = new FrameVector3D(rootJointWrench.getLinearPart());
 FrameVector3D rootJointTorque = new FrameVector3D(rootJointWrench.getAngularPart());
 rootJointForce.changeFrame(ReferenceFrame.getWorldFrame());
 rootJointTorque.changeFrame(ReferenceFrame.getWorldFrame());
 computedRootJointForces.set(rootJointForce);
 computedRootJointTorques.set(rootJointTorque);
 rootJointExternalForcePoint.setForce(new Vector3D(rootJointForce));
 rootJointExternalForcePoint.setMoment(new Vector3D(rootJointTorque));
 FramePoint3D rootJointPosition = new FramePoint3D(bodyFixedFrame);
 rootJointPosition.changeFrame(ReferenceFrame.getWorldFrame());
 rootJointExternalForcePoint.setOffsetWorld(rootJointPosition);
 ArrayList<OneDegreeOfFreedomJoint> oneDegreeOfFreedomJoints = new ArrayList<OneDegreeOfFreedomJoint>();
 robot.getAllOneDegreeOfFreedomJoints(oneDegreeOfFreedomJoints);
 for (OneDegreeOfFreedomJoint oneDegreeOfFreedomJoint : oneDegreeOfFreedomJoints)
 {
   OneDoFJointBasics oneDoFJoint = fullRobotModel.getOneDoFJointByName(oneDegreeOfFreedomJoint.getName());
   double inverseDynamicsTorque = oneDoFJoint.getTau();
   oneDegreeOfFreedomJoint.setTau(inverseDynamicsTorque);
   YoDouble computedJointTorque = computedJointTorques.get(oneDoFJoint);
   computedJointTorque.set(inverseDynamicsTorque);
 }
}

代码示例来源:origin: us.ihmc/mecano

wrench.setIncludingFrame(unitJointTwist);
wrench.setBodyFrame(successorFrame);
wrench.changeFrame(afterJointFrame);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com