gpt4 book ai didi

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

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

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

Wrench.getBodyFrame介绍

暂无

代码示例

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

public void reset()
{
 for (int i = 0; i < listOfBodiesWithExternalWrenches.size(); i++)
 {
   Wrench externalWrench = externalWrenches.get(listOfBodiesWithExternalWrenches.get(i));
   externalWrench.setToZero(externalWrench.getBodyFrame(), externalWrench.getReferenceFrame());
 }
}

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

private void compareWrenches(Wrench inputWrench, Wrench outputWrench)
{
 inputWrench.getBodyFrame().checkReferenceFrameMatch(outputWrench.getBodyFrame());
 inputWrench.getReferenceFrame().checkReferenceFrameMatch(outputWrench.getReferenceFrame());
 double epsilon = 1e-12; //3;
 EuclidCoreTestTools.assertTuple3DEquals(new Vector3D(inputWrench.getAngularPart()), new Vector3D(outputWrench.getAngularPart()), epsilon);
 EuclidCoreTestTools.assertTuple3DEquals(new Vector3D(inputWrench.getLinearPart()), new Vector3D(outputWrench.getLinearPart()), epsilon);
}

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

public static void compareWrenches(WrenchReadOnly inputWrench, Wrench outputWrench)
{
 inputWrench.getBodyFrame().checkReferenceFrameMatch(outputWrench.getBodyFrame());
 outputWrench.changeFrame(inputWrench.getReferenceFrame());
 inputWrench.getReferenceFrame().checkReferenceFrameMatch(outputWrench.getReferenceFrame());
 double epsilon = 1e-4;
 EuclidCoreTestTools.assertTuple3DEquals(new Vector3D(inputWrench.getAngularPart()), new Vector3D(outputWrench.getAngularPart()), epsilon);
 EuclidCoreTestTools.assertTuple3DEquals(new Vector3D(inputWrench.getLinearPart()), new Vector3D(outputWrench.getLinearPart()), epsilon);
}

代码示例来源: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/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