gpt4 book ai didi

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

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

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

Wrench.get介绍

暂无

代码示例

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

static void compareWrenches(WrenchReadOnly inputWrench, Wrench outputWrench, DenseMatrix64F selectionMatrix)
{
 inputWrench.getBodyFrame().checkReferenceFrameMatch(outputWrench.getBodyFrame());
 outputWrench.changeFrame(inputWrench.getReferenceFrame());
 inputWrench.getReferenceFrame().checkReferenceFrameMatch(outputWrench.getReferenceFrame());
 DenseMatrix64F inputWrenchMatrix = new DenseMatrix64F(Wrench.SIZE, 1);
 DenseMatrix64F outputWrenchMatrix = new DenseMatrix64F(Wrench.SIZE, 1);
 DenseMatrix64F selectedValues = new DenseMatrix64F(Wrench.SIZE, 1);
 inputWrench.get(inputWrenchMatrix);
 outputWrench.get(outputWrenchMatrix);
 double epsilon = 1e-4;
 int taskSize = selectionMatrix.getNumRows();
 int colIndex = 0;
 for (int i = 0; i < taskSize; i++)
   for (int j = colIndex; j < Wrench.SIZE; j++)
    if (selectionMatrix.get(i, j) == 1)
      selectedValues.set(j, 0, 1);
 // only compare the selected values
 for (int i = 0; i < Wrench.SIZE; i++)
 {
   if (selectedValues.get(i, 0) == 1)
    Assert.assertEquals(inputWrenchMatrix.get(i, 0), outputWrenchMatrix.get(i, 0), epsilon);
 }
}

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

/**
 * Second pass going from leaves to the root.
 * <p>
 * The net wrenches are propagated upstream and summed up at each rigid-body to compute the joint
 * effort.
 * </p>
 */
public void passTwo()
{
  for (int childIndex = 0; childIndex < children.size(); childIndex++)
  {
   children.get(childIndex).passTwo();
  }
  if (isRoot())
   return;
  jointWrench.sub(externalWrench);
  jointWrench.changeFrame(getFrameAfterJoint());
  for (int childIndex = 0; childIndex < children.size(); childIndex++)
  {
   jointForceFromChild.setIncludingFrame(children.get(childIndex).jointWrench);
   jointForceFromChild.changeFrame(getFrameAfterJoint());
   jointWrench.add(jointForceFromChild);
  }
  jointWrench.get(jointWrenchMatrix);
  CommonOps.multTransA(S, jointWrenchMatrix, tau);
  for (int dofIndex = 0; dofIndex < getJoint().getDegreesOfFreedom(); dofIndex++)
  {
   jointTauMatrix.set(jointIndices[dofIndex], 0, tau.get(dofIndex, 0));
  }
}

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

public static void compareWrenches(WrenchReadOnly inputWrench, Wrench outputWrench, SelectionMatrix6D selectionMatrix)
{
 inputWrench.getBodyFrame().checkReferenceFrameMatch(outputWrench.getBodyFrame());
 outputWrench.changeFrame(inputWrench.getReferenceFrame());
 inputWrench.getReferenceFrame().checkReferenceFrameMatch(outputWrench.getReferenceFrame());
 DenseMatrix64F inputWrenchMatrix = new DenseMatrix64F(Wrench.SIZE, 1);
 DenseMatrix64F outputWrenchMatrix = new DenseMatrix64F(Wrench.SIZE, 1);
 inputWrench.get(inputWrenchMatrix);
 outputWrench.get(outputWrenchMatrix);
 double epsilon = 1e-4;
 if (selectionMatrix.isAngularXSelected())
   Assert.assertEquals(inputWrenchMatrix.get(0, 0), outputWrenchMatrix.get(0, 0), epsilon);
 if (selectionMatrix.isAngularYSelected())
   Assert.assertEquals(inputWrenchMatrix.get(1, 0), outputWrenchMatrix.get(1, 0), epsilon);
 if (selectionMatrix.isAngularZSelected())
   Assert.assertEquals(inputWrenchMatrix.get(2, 0), outputWrenchMatrix.get(2, 0), epsilon);
 if (selectionMatrix.isLinearXSelected())
   Assert.assertEquals(inputWrenchMatrix.get(3, 0), outputWrenchMatrix.get(3, 0), epsilon);
 if (selectionMatrix.isLinearYSelected())
   Assert.assertEquals(inputWrenchMatrix.get(4, 0), outputWrenchMatrix.get(4, 0), epsilon);
 if (selectionMatrix.isLinearZSelected())
   Assert.assertEquals(inputWrenchMatrix.get(5, 0), outputWrenchMatrix.get(5, 0), epsilon);
}

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