us.ihmc.yoVariables.variable.YoLong类的使用及代码示例

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

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

YoLong介绍

[英]Long implementation of the YoVariable class.

All abstract functions of YoVariable will be implemented using long type for interpretation. Values will be interpreted, compared, and returned as longs rather than other native types.
[中]YoVariable类的长时间实现。
YoVariable的所有抽象函数都将使用long类型进行解释。值将作为long而不是其他本机类型进行解释、比较和返回。

代码示例

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

/**
* Sets this YoInteger to its current value minus one.
*/
public void decrement()
{
 this.set(this.getLongValue() - 1);
}

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

/**
* Creates a new YoLong with the same parameters as this one, and registers it to the passed {@link YoVariableRegistry}.
*
* @param newRegistry YoVariableRegistry to duplicate this YoLong to
* @return the newly created and registered YoLong
*/
@Override public YoLong duplicate(YoVariableRegistry newRegistry)
{
 YoLong retVar = new YoLong(getName(), getDescription(), newRegistry, getManualScalingMin(), getManualScalingMax());
 retVar.set(getLongValue());
 return retVar;
}

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

@Override
  public void doControl()
  {
   for (int i = 0; i < controllers.size(); i++)
   {
     controllers.get(i).readData(currentControlTick.getLongValue());
     controllers.get(i).executeForSimulationTick(currentControlTick.getLongValue());
     controllers.get(i).waitAndWriteData(currentControlTick.getLongValue());
   }
   currentControlTick.increment();
  }
}

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

/**
* Set the value of this YoLong using the given double, passed through {@link #convertFromDoubleToLong(double)}.
*
* @param doubleValue double to convert and set this YoLong to
* @param notifyListeners boolean determining whether or not to call {@link #notifyVariableChangedListeners()}
*/
@Override public void setValueFromDouble(double doubleValue, boolean notifyListeners)
{
 set(convertFromDoubleToLong(doubleValue), notifyListeners);
}

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

@Override
  public long getValue()
  {
   return getLongValue();
  }
}

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

/**
* Sets the internal long value of this YoLong using the passed long value.
*
* <p>Effectively equivalent to {@link #set(long, boolean)}.
*
* @param value long to set this variable's value to
* @param notifyListeners boolean determining whether or not to call {@link #notifyVariableChangedListeners()}
*/
@Override public void setValueFromLongBits(long value, boolean notifyListeners)
{
 set(value, notifyListeners);
}

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

controllerTimestamp.set(threadDataSynchronizer.getTimestamp());
controllerTime.set(Conversions.nanosecondsToSeconds(controllerTimestamp.getLongValue()));
if (expectedEstimatorTick.getLongValue() != threadDataSynchronizer.getEstimatorTick())
 if (expectedEstimatorTick.getLongValue() > threadDataSynchronizer.getEstimatorTick())
   controllerLeadsEstimatorTicks.increment();
 else if (expectedEstimatorTick.getLongValue() < threadDataSynchronizer.getEstimatorTick())
   controllerLagsEstimatorTicks.increment();
 lastExpectedEstimatorTick.set(expectedEstimatorTick.getLongValue());
 lastEstimatorTick.set(threadDataSynchronizer.getEstimatorTick());
 lastEstimatorClockStartTime.set(threadDataSynchronizer.getEstimatorClockStartTime());
 lastControllerClockTime.set(currentClockTime);
 timePassedSinceEstimator.set(currentClockTime - lastEstimatorStartTime.getLongValue());
 timePassedBetweenEstimatorTicks.set(estimatorStartTime - lastEstimatorStartTime.getLongValue());
expectedEstimatorTick.set(threadDataSynchronizer.getEstimatorTick() + estimatorTicksPerControlTick);
controllerStartTime.set(currentClockTime);
lastEstimatorStartTime.set(estimatorStartTime);

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

public YoMultipleFramesHelper(String namePrefix, YoVariableRegistry registry, ReferenceFrame... referenceFrames)
{
 if (referenceFrames == null || referenceFrames.length == 0)
   throw new RuntimeException("Need to provide at least one ReferenceFrame.");
 
 currentFrameId = new YoLong(namePrefix + "FrameId", registry);
 currentFrameId.set(referenceFrames[0].hashCode());
 for (ReferenceFrame referenceFrame : referenceFrames)
 {
   this.registerReferenceFrame(referenceFrame);
 }
}

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

private void updatePacketDropStatistics()
  {
   if(isLastPacketDropped())
   {
     totalPacketDropCount.increment();
     consecutivePacketDropCount.increment();
   }
   else
   {
     consecutivePacketDropCount.set(0);
   }
      
  }
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-logger

GCBeanHolder(String name, GarbageCollectorMXBean gcBean)
{
  this.gcBean = gcBean;
  this.gcInvocations = new YoLong(name + "GCInvocations", registry);
  this.gcTotalCollectionTimeMs = new YoLong(name + "GCTotalTimeMs", registry);
}

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

/**
* Returns String representation of this YoLong.
*
* @return a String representing this YoLong and its current value as a long
*/
@Override public String toString()
{
 return String.format("%s: %d", getName(), getLongValue());
}

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

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

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

@Override
public void run()
{
 q_j1_d.set(q_j1_d.getDoubleValue() + 0.1);
 q_j2_d.set(q_j2_d.getDoubleValue() + 0.05);
 
 tau_j1.set(kp.getDoubleValue() * (q_j1_d.getDoubleValue() - q_j1.getDoubleValue()) + kd.getDoubleValue() * (-qd_j1.getDoubleValue()));
 tau_j2.set(kp.getDoubleValue() * (q_j2_d.getDoubleValue() - q_j2.getDoubleValue()) + kd.getDoubleValue() * (-qd_j2.getDoubleValue()));
 
 tick.increment();
 
 long start = System.nanoTime();
 while(System.nanoTime() - start < Conversions.millisecondsToNanoseconds(10))
 {
   // Busy wait
 }
}

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

private void updateIsControllerTick()
{
 if (controllerTimerCount == null)
 {
   isControllerTick = true;
   return;
 }
 isControllerTick = controllerTimerCount.getLongValue() != lastControllerTimerCount;
 lastControllerTimerCount = controllerTimerCount.getLongValue();
}

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

/**
* Calls {@link #set(long, boolean)} with value and true.
*
* @param value long to set this YoInteger's internal integer state to
*/
public void set(long value)
{
 set(value, true);
}

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

public void update(ByteBuffer buffer) throws IOException
 lastMicroControllerTime = microControllerTime.getLongValue();
   checksumFailures.increment();
   totalPacketDropCount.increment();
   consecutivePacketDropCount.increment();
   return;
 microControllerTime.set(buffer.getInt() & 0xFFFFFFFFl);
 actualActuatorDT.set(microControllerTime.getLongValue() - lastMicroControllerTime);
 inphaseCompositeStatorCurrent.set(buffer.getFloat());
 quadratureCompositeStatorCurrent.set(buffer.getFloat());
 jointEncoderVelocity.set(buffer.getFloat()*jointEncoderScale*velocityScale);
 lastReceivedControlID.set(buffer.getInt() & 0xFFFFFFFFl);

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

nanosecondstime = new YoLong("longtime", registry);
total_time = new YoDouble("time", registry);
startTime = new YoDouble("startTime", registry);
walking_time = new YoDouble("walkingtime", registry);
expo_isWalking = new YoBoolean("walk", registry);
startingStepCount = new YoLong("expoStartingStepCount", registry);
COT = new YoDouble("COT", registry);
nanosecondstime.set(1234567890);
startTime.set(0.0);
expo_isWalking.set(false);
walking_time.set(6100.0);
init_complete = true;
startingStepCount.set(123);
distanceTraveled.set(1.0);
startDistance.set(0.0);
walking_time = new YoDouble("expoWalkingTime", parentRegistry);
expo_isWalking = (YoBoolean) parentRegistry.getVariable("DesiredFootstepCalculatorFootstepProviderWrapper","walk");
startingStepCount = new YoLong("expoStartingStepCount", parentRegistry);

代码示例来源:origin: us.ihmc/ihmc-convex-optimization-adapter

@Override
public int solve(DenseMatrix64F Q, DenseMatrix64F f, DenseMatrix64F Aeq, DenseMatrix64F beq, DenseMatrix64F Ain, DenseMatrix64F bin, DenseMatrix64F x,
   boolean initialize) throws NoConvergenceException
{
 //allocate on demand
 if (linearInequalityActiveSet == null)
   linearInequalityActiveSet = new boolean[Ain.numRows];
 else if (linearInequalityActiveSet.length != Ain.numRows)
 {
   System.err.println("linearInequalitySize changes, cold start with empty set");
   linearInequalityActiveSet = new boolean[Ain.numRows];
 }
 if (initialize)
   Arrays.fill(linearInequalityActiveSet, false);
 int iter = solver.solve(Q, f, Aeq, beq, Ain, bin, linearInequalityActiveSet, x);
 simpleSolverIterations.set(iter);
 if (iter < 0)
 {
   fullSolverCount.increment();
   Arrays.fill(linearInequalityActiveSet, false);
   fullSolver.solve(Q, f, Aeq, beq, Ain, bin, x, initialize);
 }
 return iter;
}

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

public AbstractThreadedRobotController(String name)
{
 this.name = name;
 this.registry = new YoVariableRegistry(name);
 this.currentControlTick = new YoLong("currentControlTick", registry);
 this.yoTime = new YoDouble("time", registry);
 this.simulatedRobot = null;
}

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

corruptedPackets.increment();

相关文章