us.ihmc.yoVariables.variable.YoDouble.getValue()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(108)

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

YoDouble.getValue介绍

[英]Retrieves this YoDouble's value as a double.

Effectively equivalent to #getDoubleValue().
[中]将此YoDouble的值检索为double。
实际上相当于#getDoubleValue()。

代码示例

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

@Override
public double getProportionalGain()
{
 return proportionalGain.getValue();
}

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

@Override
public double getPositionDeadband()
{
 return positionDeadband.getValue();
}

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

public double getTime()
{
  return time.getValue();
}

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

@Override
public double getDerivativeGain()
{
 return derivativeGain.getValue();
}

代码示例来源:origin: us.ihmc/ihmc-whole-body-controller

public double getJointCalibrationPosition(OneDoFJointBasics joint)
{
 YoDouble yoDesiredPosition = desiredPositions.get(joint);
 if (yoDesiredPosition != null)
   return yoDesiredPosition.getValue();
 else
   return 0.0;
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

public void set(YoDouble baseX, YoDouble baseY, YoDouble baseZ, YoDouble x, YoDouble y, YoDouble z)
{
 base.set(baseX.getValue(), baseY.getValue(), baseZ.getValue());
 vector.set(x.getValue(), y.getValue(), z.getValue());
}

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

public double getFingerJointTransmissionScale(RobotSide robotSide, ValkyrieHandJointName jointName)
{
 return sideDependentScales.get(robotSide).get(jointName).getValue();
}

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

private void getOneDoFJointStateFromSCS()
{
  for (OneDoFJointBasics joint : allOneDoFJoints)
  {
   PinJoint scsJoint = (PinJoint) robot.getJoint(joint.getName());
   joint.setQ(scsJoint.getQ());
   joint.setQd(scsJoint.getQD());
   double tau = scsJoint.getTau();
   if (scsJoint.tauDamping != null)
     tau += scsJoint.tauDamping.getValue();
   if (scsJoint.tauJointLimit != null)
     tau += scsJoint.tauJointLimit.getValue();
   if (scsJoint.tauVelocityLimit != null)
     tau += scsJoint.tauVelocityLimit.getValue();
   joint.setTau(tau);
  }
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

@Override
protected void computeRotationTranslation(AffineTransform transform3D)
{
 transform3D.setIdentity();
 transform3D.setScale(scale * radii.getX(), scale * radii.getY(), scale * radii.getZ());
 transform3D.setRotationYawPitchRoll(yawPitchRoll.getYaw().getValue(), yawPitchRoll.getPitch().getValue(), yawPitchRoll.getRoll().getValue());
 transform3D.setTranslation(position);
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

@Override
protected void computeRotationTranslation(AffineTransform transform3D)
{
 transform3D.setIdentity();
 double globalScale = 1.0;
 if (globalScaleProvider != null)
 {
   globalScale = globalScaleProvider.getValue();
 }
 transform3D.setScale(scale * globalScale);
 if (isUsingYawPitchRoll())
   transform3D.setRotationYawPitchRoll(yawPitchRoll.getYaw().getValue(), yawPitchRoll.getPitch().getValue(), yawPitchRoll.getRoll().getValue());
 else
   transform3D.setRotation(quaternion);
 transform3D.setTranslation(position);
}

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

public boolean isDone()
{
 if (isEmpty())
   return true;
 boolean isLastWaypoint = currentWaypointIndex.getIntegerValue() >= numberOfWaypoints.getIntegerValue() - 2;
 if (!isLastWaypoint)
   return false;
 return currentTrajectoryTime.getValue() >= waypoints.get(currentWaypointIndex.getValue() + 1).getTime();
}

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

@Override
public boolean isDone()
{
 if (isEmpty())
   return true;
 boolean isLastWaypoint = currentWaypointIndex.getIntegerValue() >= numberOfWaypoints.getIntegerValue() - 2;
 if (!isLastWaypoint)
   return false;
 return currentTrajectoryTime.getValue() >= waypoints.get(currentWaypointIndex.getValue() + 1).getTime();
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

private void sendFootstepPlan()
{
 FootstepPlanningToolboxOutputStatus plannerResult = this.plannerResult.getAndSet(null);
 FootstepDataListMessage footstepDataListMessage = plannerResult.getFootstepDataList();
 footstepDataListMessage.setDefaultSwingDuration(swingTime.getValue());
 footstepDataListMessage.setDefaultTransferDuration(transferTime.getDoubleValue());
 footstepDataListMessage.setDestination(PacketDestination.CONTROLLER.ordinal());
 footstepPublisher.publish(footstepDataListMessage);
}

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

@Override
public void compute(double time)
{
 integratedPhaseAngle.add(2.0 * Math.PI * frequency.getValue() * controlDT);
 double angle = integratedPhaseAngle.getValue();
 double mult = 2.0 * Math.PI * frequency.getValue();
 double alpha = 0.5 * Math.sin(angle) + 0.5;
 double alphaDot = 0.5 * 2.0 * mult * Math.cos(angle);
 double alphaDDot = -0.5 * 2.0 * 2.0 * mult * mult * Math.sin(angle);
 limitedPointA.update();
 limitedPointB.update();
 position.interpolate(limitedPointA, limitedPointB, alpha);
 linearVelocity.sub(limitedPointB, limitedPointA);
 linearVelocity.scale(alphaDot);
 linearAcceleration.sub(limitedPointB, limitedPointA);
 linearAcceleration.scale(alphaDDot);
}

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

@Override
 public YoDouble duplicate(YoVariableRegistry newRegistry)
 {
   DoubleParameter newParameter = new DoubleParameter(getName(), getDescription(), newRegistry, initialValue, getManualScalingMin(), getManualScalingMax());
   newParameter.value.set(value.getValue());
   newParameter.loadStatus = getLoadStatus();
   return newParameter.value;
 }
}

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

@Override
public void getRMatrix(DenseMatrix64F matrixToPack)
{
 matrixToPack.reshape(getMeasurementSize(), getMeasurementSize());
 CommonOps.setIdentity(matrixToPack);
 double percent = (loadPercentage.getValue() - weightFractionForNoTrust.getValue())
    / (weightFractionForFullTrust.getValue() - weightFractionForNoTrust.getValue());
 percent = MathTools.clamp(percent, 0.0, 1.0);
 variance.set(maxVariance.getValue() - percent * (maxVariance.getValue() - minVariance.getValue()));
 CommonOps.scale(variance.getValue() * sqrtHz, matrixToPack);
}

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

private void computeInitialConstraintOffset(double time)
{
 double startTime = initialBlendStartTime.getDoubleValue();
 double endTime = initialBlendEndTime.getDoubleValue();
 time = MathTools.clamp(time - initialBlendTimeOffset.getValue(), startTime, endTime);
 for (int i = 0; i < 3; i++)
 {
   initialConstraintPolynomial[i].compute(time);
   initialConstraintPositionOffset.setElement(i, initialConstraintPolynomial[i].getPosition());
   initialConstraintVelocityOffset.setElement(i, initialConstraintPolynomial[i].getVelocity());
   initialConstraintAccelerationOffset.setElement(i, initialConstraintPolynomial[i].getAcceleration());
 }
}

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

private void computeFinalConstraintOffset(double time)
  {
   double startTime = finalBlendStartTime.getDoubleValue();
   double endTime = finalBlendEndTime.getDoubleValue();
   time = MathTools.clamp(time - finalBlendTimeOffset.getValue(), startTime, endTime);

   for (int i = 0; i < 3; i++)
   {
     finalConstraintPolynomial[i].compute(time);
     finalConstraintPositionOffset.setElement(i, finalConstraintPolynomial[i].getPosition());
     finalConstraintVelocityOffset.setElement(i, finalConstraintPolynomial[i].getVelocity());
     finalConstraintAccelerationOffset.setElement(i, finalConstraintPolynomial[i].getAcceleration());
   }
  }
}

代码示例来源:origin: us.ihmc/ihmc-sensor-processing-test

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testDefaultMaximumDeflection4()
{
 Random random = new Random(1561651L);
 
 String name = "compensator";
 YoVariableRegistry registry = new YoVariableRegistry("");
 YoDouble stiffness = new YoDouble("stiffness", registry);
 YoDouble maximumDeflection = new YoDouble("maximumDeflection", registry);
 YoDouble rawJointPosition = new YoDouble("rawJointPosition", registry);
 YoDouble jointTau = new YoDouble("jointTau", registry);
 ElasticityCompensatorYoVariable elasticityCompensatorYoVariable = new ElasticityCompensatorYoVariable(name, stiffness, maximumDeflection, rawJointPosition, jointTau, registry);
 maximumDeflection.set(0.1);
 for (int i = 0; i < 10000; i++)
 {
   stiffness.set(RandomNumbers.nextDouble(random, 1.0, 100000.0));
   rawJointPosition.set(RandomNumbers.nextDouble(random, 100.0));
   jointTau.set(RandomNumbers.nextDouble(random, 10000.0));
   elasticityCompensatorYoVariable.update();
   double deflectedJointPosition = rawJointPosition.getDoubleValue() - MathTools.clamp(jointTau.getDoubleValue() / stiffness.getDoubleValue(), maximumDeflection.getValue());
   assertEquals(deflectedJointPosition, elasticityCompensatorYoVariable.getDoubleValue(), EPSILON);
 }
}

代码示例来源:origin: us.ihmc/ihmc-sensor-processing-test

@ContinuousIntegrationTest(estimatedDuration = 0.0)
  @Test(timeout = 30000)
  public void testRandomMaximumDeflection4()
  {
   Random random = new Random(1561651L);
   
   String name = "compensator";
   YoVariableRegistry registry = new YoVariableRegistry("");
   YoDouble stiffness = new YoDouble("stiffness", registry);
   YoDouble maximumDeflection = new YoDouble("maximumDeflection", registry);
   YoDouble rawJointPosition = new YoDouble("rawJointPosition", registry);
   YoDouble jointTau = new YoDouble("jointTau", registry);
   ElasticityCompensatorYoVariable elasticityCompensatorYoVariable = new ElasticityCompensatorYoVariable(name, stiffness, maximumDeflection, rawJointPosition, jointTau, registry);
   maximumDeflection.set(0.1);
   
   for (int i = 0; i < 10000; i++)
   {
     stiffness.set(RandomNumbers.nextDouble(random, 1.0, 100000.0));
     rawJointPosition.set(RandomNumbers.nextDouble(random, 100.0));
     jointTau.set(RandomNumbers.nextDouble(random, 10000.0));
     maximumDeflection.set(RandomNumbers.nextDouble(random, 0.0, 10.0));
     elasticityCompensatorYoVariable.update();

     double deflectedJointPosition = rawJointPosition.getDoubleValue() - MathTools.clamp(jointTau.getDoubleValue() / stiffness.getDoubleValue(), maximumDeflection.getValue());

     assertEquals(deflectedJointPosition, elasticityCompensatorYoVariable.getDoubleValue(), EPSILON);
   }
  }
}

相关文章