gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-17 01:14:40 27 4
gpt4 key购买 nike

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

YoInteger.getValue介绍

[英]Retrieves this YoInteger's value as a double.
[中]以双精度形式检索此整数的值。

代码示例

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

/** {@inheritDoc} */
@Override
public int getNumberOfVertices()
{
 return numberOfVertices.getValue();
}

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

public int getCurrentNumberOfWaypoints()
{
 return numberOfWaypoints.getValue();
}

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

/** {@inheritDoc} */
@Override
public void updateCentroidAndArea()
{
 area = EuclidGeometryPolygonTools.computeConvexPolyong2DArea(vertexBuffer, numberOfVertices.getValue(), clockwiseOrdered, centroid);
}

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

public void set(List<? extends Point3DReadOnly> points)
{
 if (points.size() > this.ccwOrderedYoFramePoints.length)
   throw new RuntimeException("Cannot plot more vertices than the maximum number");
 numberOfPoints.set(points.size());
 for (int i = 0; i < numberOfPoints.getValue(); i++)
   ccwOrderedYoFramePoints[i].set(points.get(i));
 for (int i = numberOfPoints.getValue(); i < ccwOrderedYoFramePoints.length; i++)
   ccwOrderedYoFramePoints[i].setToNaN();
}

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

/** {@inheritDoc} */
@Override
public void addVertex(double x, double y)
{
 isUpToDate = false;
 YoFramePoint2D newVertex = vertexBuffer.get(numberOfVertices.getValue());
 if (newVertex == null)
   throw new RuntimeException("This polygon has reached its maximum number of vertices.");
 newVertex.set(x, y);
 numberOfVertices.increment();
}

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

private void initializeSubTrajectory(int waypointIndex)
{
 int secondWaypointIndex = Math.min(waypointIndex + 1, numberOfWaypoints.getValue() - 1);
 subTrajectory.setTrajectoryParameters(waypoints.get(waypointIndex), waypoints.get(secondWaypointIndex));
 subTrajectory.initialize();
}

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

public void set(Point3DReadOnly[] points)
{
 if (points.length > this.ccwOrderedYoFramePoints.length)
   throw new RuntimeException("Cannot plot more vertices than the maximum number");
 numberOfPoints.set(points.length);
 for (int i = 0; i < numberOfPoints.getValue(); i++)
   ccwOrderedYoFramePoints[i].set(points[i]);
 for (int i = numberOfPoints.getValue(); i < ccwOrderedYoFramePoints.length; i++)
   ccwOrderedYoFramePoints[i].setToNaN();
}

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

private double solveMinAcceleration()
{
 double cost = 0;
 x.clear();
 for (int dimension = 0; dimension < dimensions.getValue(); dimension++)
 {
   cost += solveDimension(dimension, x.add());
 }
 return cost;
}

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

/** {@inheritDoc} */
@Override
public void removeVertex(int indexOfVertexToRemove)
{
 checkNonEmpty();
 checkIndexInBoundaries(indexOfVertexToRemove);
 if (indexOfVertexToRemove == numberOfVertices.getValue() - 1)
 {
   numberOfVertices.decrement();
   ;
   return;
 }
 isUpToDate = false;
 swap(vertexBuffer, indexOfVertexToRemove, numberOfVertices.getValue());
 numberOfVertices.decrement();
}

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

private void initializeSubTrajectory(int waypointIndex)
{
 int secondWaypointIndex = Math.min(waypointIndex + 1, numberOfWaypoints.getValue() - 1);
 YoFrameEuclideanTrajectoryPoint start = waypoints.get(waypointIndex);
 YoFrameEuclideanTrajectoryPoint end = waypoints.get(secondWaypointIndex);
 subTrajectory.setCubic(0.0, end.getTime() - start.getTime(), start.getPosition(), start.getLinearVelocity(), end.getPosition(), end.getLinearVelocity());
}

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

/** {@inheritDoc} */
@Override
public void update()
{
 if (isUpToDate)
   return;
 numberOfVertices.set(EuclidGeometryPolygonTools.inPlaceGiftWrapConvexHull2D(vertexBuffer, numberOfVertices.getValue()));
 isUpToDate = true;
 updateCentroidAndArea();
 updateBoundingBox();
}

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

public void compute(double time)
{
 if (isEmpty())
 {
   throw new RuntimeException("Can not call compute on an empty trajectory.");
 }
 currentTrajectoryTime.set(time);
 if (time < waypoints.get(currentWaypointIndex.getIntegerValue()).getTime())
 {
   currentWaypointIndex.set(0);
 }
 while (currentWaypointIndex.getIntegerValue() < numberOfWaypoints.getIntegerValue() - 2
    && time >= waypoints.get(currentWaypointIndex.getIntegerValue() + 1).getTime())
 {
   currentWaypointIndex.increment();
 }
 int secondWaypointIndex = Math.min(currentWaypointIndex.getValue() + 1, numberOfWaypoints.getValue() - 1);
 YoSpatialWaypoint start = waypoints.get(currentWaypointIndex.getValue());
 YoSpatialWaypoint end = waypoints.get(secondWaypointIndex);
 double alpha = (time - start.getTime()) / (end.getTime() - start.getTime());
 alpha = MathTools.clamp(alpha, 0.0, 1.0);
 currentValue.getAngularPart().interpolate(start.getAngularPart(), end.getAngularPart(), alpha);
 currentValue.getLinearPart().interpolate(start.getLinearPart(), end.getLinearPart(), alpha);
}

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

@Test(timeout = 30000)
public void testSort()
{
 YoPreallocatedList<YoInteger> list = new YoPreallocatedList<>(YoInteger.class, "Test", 10, new YoVariableRegistry("Test"));
 list.add().set(-3);
 list.add().set(20);
 list.add().set(-10);
 list.add().set(19);
 list.add().set(50);
 list.sort((o1, o2) -> NumberUtils.compare(o1.getIntegerValue(), o2.getIntegerValue()));
 assertTrue(list.get(0).getValue() == -10);
 assertTrue(list.get(1).getValue() == -3);
 assertTrue(list.get(2).getValue() == 19);
 assertTrue(list.get(3).getValue() == 20);
 assertTrue(list.get(4).getValue() == 50);
}

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

@Test(timeout = 30000)
public void testRemoveIndex()
{
 int size = 10;
 YoPreallocatedList<YoInteger> list = new YoPreallocatedList<>(YoInteger.class, "Test", size, new YoVariableRegistry("Test"));
 for (int i = 0; i < size; i++)
 {
   list.add().set(i);
 }
 assertTrue(list.remove(8).getValue() == 8);
 assertTrue(list.size() == size - 1);
 assertTrue(list.remove(4).getValue() == 4);
 assertTrue(list.size() == size - 2);
 assertTrue(list.remove(2).getValue() == 2);
 assertTrue(list.size() == size - 3);
 assertTrue(list.remove(size - 4).getValue() == size - 1);
 assertTrue(list.size() == size - 4);
}

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

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

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

private void updateInternal()
{
 stageTime.add(Conversions.millisecondsToSeconds(tickDurationMs));
 if (stageTime.getDoubleValue() > 20.0)
 {
   if (debug)
    PrintTools.info("Hard timeout at " + stageTime.getDoubleValue());
   return;
 }
 sendMessageToUI(
    "Starting To Plan: " + planId.getValue() + " sequence: " + sequenceId.getValue() + ", using type " + activePlannerEnum.getValue().toString()
       + " on stage " + stageId);
 if (debug)
   PrintTools.info("Stage " + stageId + " planning steps.");
 stepPlanResult = plan();
 if (stepPlanResult.validForExecution())
   stepPlan.set(getPlanner().getPlan());
 for (PlannerCompletionCallback completionCallback : completionCallbackList)
   completionCallback.stepPlanningIsComplete(stepPlanResult, this);
}

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

buildConstraintMatrixForDimension(dimension, A, b);
int subProblemSize = coefficients * intervals.getValue();
int constraints = 4 + 3 * nWaypoints.getValue();

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

private void buildConstraintMatrixForDimension(int dimension, DenseMatrix64F A, DenseMatrix64F b)
 int constraints = 4 + 3 * nWaypoints.getValue();
 int subProblemSize = coefficients * intervals.getValue();
 A.reshape(constraints, subProblemSize);
 b.reshape(constraints, 1);

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