gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-17 15:02:40 26 4
gpt4 key购买 nike

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

YoDouble.add介绍

[英]Sets this YoDouble to its current value plus the given value.
[中]将此值设置为当前值加上给定值。

代码示例

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

public void add(double yaw, double pitch, double roll)
{
 this.yaw.add(yaw);
 this.pitch.add(pitch);
 this.roll.add(roll);
}

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

@Override
public void addTimeOffset(double timeOffsetToAdd)
{
 time.add(timeOffsetToAdd);
}

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

@Override
public final void addTimeOffset(double timeOffsetToAdd)
{
 time.add(timeOffsetToAdd);
}

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

public void update(double dataSource)
{
 dataLength.increment();
 dataCumulated.add(dataSource);
}

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

public void add(YoFrameYawPitchRoll orientation)
{
 yaw.add(orientation.getYaw());
 pitch.add(orientation.getPitch());
 roll.add(orientation.getRoll());
}

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

@Override
public void initialize()
{
 robot.update();
 for (int i = 0; i < efp_offsetFromRootJoint.size(); i++)
 {
   initialPositions.get(i).set(externalForcePoints.get(i).getYoPosition());
   desiredHeight.add(initialPositions.get(i).getZ() / initialPositions.size());
   efp_positionViz.get(i).update();
 }
 for (int i = 0; i < efp_offsetFromRootJoint.size(); i++)
   initialPositions.get(i).setZ(desiredHeight.getDoubleValue());
 doControl();
}

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

public void computeNextTick(FramePoint3D positionToPack, double deltaT)
{
 timeIntoStep.add(deltaT);
 compute(timeIntoStep.getDoubleValue());
 getPosition(positionToPack);
}

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

public void computeNextTick(FramePoint3D positionToPack, FrameVector3D velocityToPack, FrameVector3D accelerationToPack, double deltaT)
{
 timeIntoStep.add(deltaT);
 compute(timeIntoStep.getDoubleValue());
 getLinearData(positionToPack, velocityToPack, accelerationToPack);
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

@Override
public void tickAndUpdate()
{
 scs.setTime(time.getDoubleValue());
 scs.tickAndUpdate();
 time.add(1.0);
}

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

public void computeNextTick(FramePoint3D positionToPack, FrameVector3D velocityToPack, FrameVector3D accelerationToPack, double deltaT)
{
 timeIntoStep.add(deltaT);
 compute(timeIntoStep.getDoubleValue());
 getPosition(positionToPack);
 getVelocity(velocityToPack);
 getAcceleration(accelerationToPack);
}

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

private void simulateOneTick(boolean checkForDiscontinuities, boolean checkIfDyanmicsAreSatisfied)
{
 yoTime.add(dt);
 getAllVariablesFromPlanner(planner, icpPlannerData1);
 updateUpdatables(yoTime.getDoubleValue());
 if (checkForDiscontinuities)
   testForDiscontinuities(icpPlannerData1);
 if (checkIfDyanmicsAreSatisfied)
   testIfDynamicsAreSatisfied();
 if (visualize)
   updateVisualizePerTick();
}

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

private void updateActionMode()
{
 timeInCurrentMode.add(controlDt);
 updateWindowSize();
 StictionActionMode estimatedCurrentMode = estimateCurrentActionMode();
 if (timeInCurrentMode.getDoubleValue() > minTimeInMode.getValue() && estimatedCurrentMode != stictionActionMode.getEnumValue())
 {
   stictionActionMode.set(estimatedCurrentMode);
   timeInCurrentMode.set(0.0);
 }
}

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

private void simulateOneTickAndAssertSamePlan(SmoothCMPBasedICPPlanner planner1, SmoothCMPBasedICPPlanner planner2)
{
 yoTime.add(dt);
 getAllVariablesFromPlanner(planner1, icpPlannerData1);
 getAllVariablesFromPlanner(planner2, icpPlannerData2);
 assertCoPWaypointsAreEqual(planner1, planner2, 1e-10);
 assertCMPWaypointsAreEqual(planner1, planner2, 1e-10);
 assertICPWaypointsAreEqual(planner1, planner2, 1e-10);
 assertCoMPlansAreEqual(planner1, planner2, 1e-10);
 assertPlansAreEqual(icpPlannerData1, icpPlannerData2, 1e-10);
}

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

private void doSingleTimeUpdate()
{
 // (1) do control and compute desired accelerations
 controllerToolbox.update();
 walkingController.doAction();
 ControllerCoreCommand coreCommand = walkingController.getControllerCoreCommand();
 controllerCore.submitControllerCoreCommand(coreCommand);
 controllerCore.compute();
 // (2) integrate accelerations in full robot model
 integrate();
 // update viz and advance time
 fullRobotModel.updateFrames();
 referenceFrames.updateFrames();
 yoTime.add(robotModel.getControllerDT());
}

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

@Override
public void doControl()
{
 desiredLidarAngle.add(desiredLidarVelocity.getDoubleValue() * controlDT);
    double lidarJointTau = lidarJointController.compute(lidarJoint.getQYoVariable().getDoubleValue(), desiredLidarAngle.getDoubleValue(), lidarJoint.getQDYoVariable()
    .getDoubleValue(), desiredLidarVelocity.getDoubleValue(), controlDT) + lidarJoint.getDamping() * desiredLidarVelocity.getDoubleValue();
 lidarJoint.setTau(lidarJointTau);
}

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

public void update(ByteBuffer buffer)
{
 for (int i = 0; i < ADC.length; i++)
 {
   ADC[i].set(buffer.getShort());
 }
 busVoltage.set(((double) (ADC[0].getIntegerValue() & 0xFFFF)) / 491.0 - 0.1);
 leftLimbCurrent.set((ADC[1].getValueAsDouble() + 16.0) * 0.0061);
 rightLimbCurrent.set((ADC[2].getValueAsDouble() + 14.0) * 0.0061);
 torsoLimbCurrent.set((ADC[3].getValueAsDouble() + 15.0) * 0.0061);
 robotPower.set(busVoltage.getDoubleValue() * (leftLimbCurrent.getDoubleValue() + rightLimbCurrent.getDoubleValue() + torsoLimbCurrent.getDoubleValue()));
 robotWork.add(robotPower.getDoubleValue() *  dt);
}

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

public void update(double inputPosition, double inputVelocity, double inputAcceleration)
{
 if (!hasBeenInitialized.getBooleanValue())
   initialize(inputPosition, inputVelocity, inputAcceleration);
 double positionError = inputPosition - this.getDoubleValue();
 double velocityError = inputVelocity - smoothedRate.getDoubleValue();
 double accelerationError = inputAcceleration - smoothedAcceleration.getDoubleValue();
 double jerk = accelerationGain.getDoubleValue() * accelerationError + velocityGain.getDoubleValue() * velocityError + positionGain.getDoubleValue()
    * positionError;
 jerk = MathTools.clamp(jerk, -maximumJerk.getDoubleValue(), maximumJerk.getDoubleValue());
 smoothedJerk.set(jerk);
 smoothedAcceleration.add(smoothedJerk.getDoubleValue() * dt);
 smoothedAcceleration.set(MathTools.clamp(smoothedAcceleration.getDoubleValue(), maximumJerk.getDoubleValue()));
 smoothedRate.add(smoothedAcceleration.getDoubleValue() * dt);
 this.add(smoothedRate.getDoubleValue() * dt);
}

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

@Override
public void compute(double time)
{
 currentTime.set(time);
 time = MathTools.clamp(time, 0.0, trajectoryTime.getDoubleValue());
 if (currentTime.getDoubleValue() - currentTimeOffset.getDoubleValue() > subTrajectoryTime.getDoubleValue())
 {
   currentTimeOffset.add(subTrajectoryTime.getDoubleValue());
   currentPolynomialIndex.increment();
   currentPolynomialIndex.set(Math.min(currentPolynomialIndex.getIntegerValue(), currentNumberOfWaypoints.getIntegerValue()));
 }
 time -= currentTimeOffset.getDoubleValue();
 time = MathTools.clamp(time, 0.0, subTrajectoryTime.getDoubleValue());
 
 findCurrentPolynomial().compute(time);
}

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

public void update(double input)
{
 if (!hasBeenInitialized.getBooleanValue())
   initialize(input);
 double positionError = input - this.getDoubleValue();
 double acceleration = -velocityGain.getDoubleValue() * smoothedRate.getDoubleValue() + positionGain.getDoubleValue() * positionError;
 acceleration = MathTools.clamp(acceleration, -maximumAcceleration.getDoubleValue(), maximumAcceleration.getDoubleValue());
 smoothedAcceleration.set(acceleration);
 smoothedRate.add(smoothedAcceleration.getDoubleValue() * dt);
 smoothedRate.set(MathTools.clamp(smoothedRate.getDoubleValue(), maximumRate.getDoubleValue()));
 this.add(smoothedRate.getDoubleValue() * dt);
}

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