本文整理了Java中us.ihmc.robotics.kinematics.fourbar.YoVariableSideFourbarCalculatorWithDerivatives.updateAnglesAndVelocitiesGivenAngleDAB()
方法的一些代码示例,展示了YoVariableSideFourbarCalculatorWithDerivatives.updateAnglesAndVelocitiesGivenAngleDAB()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoVariableSideFourbarCalculatorWithDerivatives.updateAnglesAndVelocitiesGivenAngleDAB()
方法的具体详情如下:
包路径:us.ihmc.robotics.kinematics.fourbar.YoVariableSideFourbarCalculatorWithDerivatives
类名称:YoVariableSideFourbarCalculatorWithDerivatives
方法名:updateAnglesAndVelocitiesGivenAngleDAB
[英]Compute every angle of the quadrilateral.
[中]计算四边形的每个角度。
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public boolean updateAnglesVelocitiesAndAccelerationsGivenAngleDAB(double angleDABInRadians, double angularVelocityDAB, double angularAccelerationDAB)
{
// Solve angles and angular velocity
boolean isAHittingBounds = updateAnglesAndVelocitiesGivenAngleDAB(angleDABInRadians, angularVelocityDAB);
// Solve angular acceleration
double A = clamp(angleDABInRadians, minA.getDoubleValue(), maxA.getDoubleValue());
double dAdT = angularVelocityDAB;
double dAdT2 = angularAccelerationDAB;
double e = unknownTriangleSideLengthByLawOfCosine(lengthAD.getDoubleValue(), lengthBA.getDoubleValue(), A);
double eDot = lengthAD.getDoubleValue() * lengthBA.getDoubleValue() * sin(A) * dAdT / e;
double eDDot = lengthAD.getDoubleValue() * lengthBA.getDoubleValue() / e * (cos(A) * dAdT * dAdT + sin(A) * (dAdT2 - eDot * dAdT / e));
double dCdT2 = FourbarCalculatorTools.getAngleDDotWithCosineLaw(lengthCB.getDoubleValue(), lengthDC.getDoubleValue(), 0.0, 0.0, e, eDot, eDDot);
double angleDDotDBA = FourbarCalculatorTools.getAngleDDotWithCosineLaw(lengthBA.getDoubleValue(), e, eDot, eDDot, lengthAD.getDoubleValue(), 0.0, 0.0);
double angleDDotDBC = FourbarCalculatorTools.getAngleDDotWithCosineLaw(lengthCB.getDoubleValue(), e, eDot, eDDot, lengthDC.getDoubleValue(), 0.0, 0.0);
double dBdT2 = angleDDotDBA + angleDDotDBC;
double dDdT2 = -dAdT2 - dBdT2 - dCdT2;
this.angleDt2DAB = dAdT2;
this.angleDt2ABC = dBdT2;
this.angleDt2BCD = dCdT2;
this.angleDt2CDA = dDdT2;
return isAHittingBounds;
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
public boolean updateAnglesVelocitiesAndAccelerationsGivenAngleDAB(double angleDABInRadians, double angularVelocityDAB, double angularAccelerationDAB)
{
// Solve angles and angular velocity
boolean isAHittingBounds = updateAnglesAndVelocitiesGivenAngleDAB(angleDABInRadians, angularVelocityDAB);
// Solve angular acceleration
double A = clipToMinMax(angleDABInRadians, minA.getDoubleValue(), maxA.getDoubleValue());
double dAdT = angularVelocityDAB;
double dAdT2 = angularAccelerationDAB;
double e = getUnknownTriangleSideLengthByLawOfCosine(lengthAD.getDoubleValue(), lengthBA.getDoubleValue(), A);
double eDot = lengthAD.getDoubleValue() * lengthBA.getDoubleValue() * sin(A) * dAdT / e;
double eDDot = lengthAD.getDoubleValue() * lengthBA.getDoubleValue() / e * (cos(A) * dAdT * dAdT + sin(A) * (dAdT2 - eDot * dAdT / e));
double dCdT2 = FourbarCalculatorTools.getAngleDDotWithCosineLaw(lengthCB.getDoubleValue(), lengthDC.getDoubleValue(), 0.0, 0.0, e, eDot, eDDot);
double angleDDotDBA = FourbarCalculatorTools.getAngleDDotWithCosineLaw(lengthBA.getDoubleValue(), e, eDot, eDDot, lengthAD.getDoubleValue(), 0.0, 0.0);
double angleDDotDBC = FourbarCalculatorTools.getAngleDDotWithCosineLaw(lengthCB.getDoubleValue(), e, eDot, eDDot, lengthDC.getDoubleValue(), 0.0, 0.0);
double dBdT2 = angleDDotDBA + angleDDotDBC;
double dDdT2 = -dAdT2 - dBdT2 - dCdT2;
this.angleDt2DAB = dAdT2;
this.angleDt2ABC = dBdT2;
this.angleDt2BCD = dCdT2;
this.angleDt2CDA = dDdT2;
return isAHittingBounds;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
private void solveFourBar(YoVariableSideFourbarCalculatorWithDerivatives calculator, double lengthA, double lengthB, double lengthC, double lengthD,
double A, double B, double C, double D)
{
if (PRINT)
{
String[] names = "a,b,c,d,A,B,C,D".split(",");
double[] vals = new double[] {lengthA, lengthB, lengthC, lengthD, A, B, C, D};
for (int i = 0; i < vals.length; i++)
{
System.out.println(names[i] + " = " + vals[i]);
}
}
calculator.setSideLengths(lengthA, lengthB, lengthC, lengthD);
calculator.updateAnglesAndVelocitiesGivenAngleDAB(A, 0.0);
assertEquals(A, calculator.getAngleDAB(), eps);
assertEquals(B, calculator.getAngleABC(), eps);
assertEquals(C, calculator.getAngleBCD(), eps);
assertEquals(D, calculator.getAngleCDA(), eps);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testSquareDer()
{
YoVariableSideFourbarCalculatorWithDerivatives calculator = new YoVariableSideFourbarCalculatorWithDerivatives("testCalculator", registry);
calculator.setSideLengths(1.0, 1.0, 1.0, 1.0);
calculator.updateAnglesAndVelocitiesGivenAngleDAB(PI / 2.0, 1.0);
assertEquals(1, calculator.getAngleDtDAB(), eps);
assertEquals(1, calculator.getAngleDtBCD(), eps);
assertEquals(-1, calculator.getAngleDtABC(), eps);
assertEquals(-1, calculator.getAngleDtCDA(), eps);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testParallelogram()
{
YoVariableSideFourbarCalculatorWithDerivatives calculator = new YoVariableSideFourbarCalculatorWithDerivatives("testCalculator", registry);
calculator.setSideLengths(1.0, 1.0, 1.0, 1.0);
calculator.updateAnglesAndVelocitiesGivenAngleDAB(PI / 3, 1);
assertEquals(PI / 3, calculator.getAngleDAB(), eps);
assertEquals(2 * PI / 3, calculator.getAngleABC(), eps);
assertEquals(PI / 3, calculator.getAngleBCD(), eps);
assertEquals(2 * PI / 3, calculator.getAngleCDA(), eps);
assertEquals(1, calculator.getAngleDtDAB(), eps);
assertEquals(1, calculator.getAngleDtBCD(), eps);
assertEquals(-1, calculator.getAngleDtABC(), eps);
assertEquals(-1, calculator.getAngleDtCDA(), eps);
}
内容来源于网络,如有侵权,请联系作者删除!