- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中us.ihmc.yoVariables.variable.YoFrameVector2D
类的一些代码示例,展示了YoFrameVector2D
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoFrameVector2D
类的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoFrameVector2D
类名称:YoFrameVector2D
[英]FixedFrameVector2DBasics implementation which components x, y are baked with YoDoubles.
[中]FixedFrameVector2DBasics实现,其中x、y组件用Yodouble烘焙。
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Creates a copy of {@code this} by finding the duplicated {@code YoVariable}s in the given
* {@link YoVariableRegistry}.
* <p>
* This method does not duplicate {@code YoVariable}s. Assuming the given registry is a duplicate
* of the registry that was used to create {@code this}, this method searches for the duplicated
* {@code YoVariable}s and use them to duplicate {@code this}.
* </p>
*
* @param newRegistry YoVariableRegistry to duplicate {@code this} to.
* @return the duplicate of {@code this}.
*/
public YoFrameVector2D duplicate(YoVariableRegistry newRegistry)
{
YoDouble x = (YoDouble) newRegistry.getVariable(getYoX().getFullNameWithNameSpace());
YoDouble y = (YoDouble) newRegistry.getVariable(getYoY().getFullNameWithNameSpace());
return new YoFrameVector2D(x, y, getReferenceFrame());
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public void computeForcePerturbance()
{
if (perturbanceUnitVector.getX() > 0.0)
{
perturbanceForce.setX(perturbanceUnitVector.getX() * xPosForce);
}
else
{
perturbanceForce.setX(perturbanceUnitVector.getX() * xNegForce);
}
if (perturbanceUnitVector.getY() > 0.0)
{
perturbanceForce.setY(perturbanceUnitVector.getY() * yPosForce);
}
else
{
perturbanceForce.setY(perturbanceUnitVector.getY() * yNegForce);
}
}
代码示例来源:origin: us.ihmc/ihmc-graphics-description
public YoArtifactOval(String name, YoFramePoint2D center, YoFrameVector2D radii, Color color)
{
super(name, new double[0], color, center.getYoX(), center.getYoY(), radii.getYoX(), radii.getYoY());
this.center = center;
this.radii = radii;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public static RateLimitedYoFrameVector2d createRateLimitedYoFrameVector2d(String namePrefix, String nameSuffix, YoVariableRegistry registry,
YoDouble maxRate, double dt, YoFrameVector2D unfilteredVector)
{
RateLimitedYoVariable x = new RateLimitedYoVariable(YoFrameVariableNameTools.createXName(namePrefix, nameSuffix), registry, maxRate, unfilteredVector.getYoX(), dt);
RateLimitedYoVariable y = new RateLimitedYoVariable(YoFrameVariableNameTools.createYName(namePrefix, nameSuffix), registry, maxRate, unfilteredVector.getYoY(), dt);
RateLimitedYoFrameVector2d ret = new RateLimitedYoFrameVector2d(x, y, unfilteredVector.getReferenceFrame());
return ret;
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Creates a new {@code YoFrameLine2D}.
*
* @param namePrefix a unique name string to use as the prefix for child variable names.
* @param nameSuffix a string to use as the suffix for child variable names.
* @param referenceFrame the reference frame for this line.
* @param registry the registry to register child variables to.
*/
public YoFrameLine2D(String namePrefix, String nameSuffix, ReferenceFrame referenceFrame, YoVariableRegistry registry)
{
point = new YoFramePoint2D(namePrefix, nameSuffix, referenceFrame, registry);
direction = new YoFrameVector2D(namePrefix, nameSuffix, referenceFrame, registry);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
YoFrameVector2D radii = new YoFrameVector2D("radii", ReferenceFrame.getWorldFrame(), registry);
center.set(-1.0, -1.0);
radii.set(1.0, 0.7);
代码示例来源:origin: us.ihmc/ihmc-footstep-planning
@Override
public double calculateCost(FramePose3D stanceFoot, FramePose3D swingStartFoot, FramePose3D idealFootstep, FramePose3D candidateFootstep, double percentageOfFoothold)
{
double cost = footstepBaseCost.getDoubleValue();
setXYVectorFromPoseToPoseNormalize(forwardCostVector, swingStartFoot, idealFootstep);
setXYVectorFromPoseToPoseNormalize(backwardCostVector, idealFootstep, swingStartFoot);
inwardCostVector.set(forwardCostVector.getY(), -forwardCostVector.getX());
outwardCostVector.set(-forwardCostVector.getY(), forwardCostVector.getX());
upwardCostVector.set(0.0, 0.0, 1.0);
downwardVector.set(0.0, 0.0, -1.0);
setVectorFromPoseToPose(idealToCandidateVector, idealFootstep, candidateFootstep);
setOrientationFromPoseToPose(idealToCandidateOrientation, idealFootstep, candidateFootstep);
double downwardPenalizationWeightConsideringStancePitch = downwardCostScalar.getDoubleValue();
if (stanceFoot.getPitch() < 0)
{
downwardPenalizationWeightConsideringStancePitch += -stanceFoot.getPitch() * stancePitchDownwardCostScalar.getDoubleValue();
}
cost += penalizeCandidateFootstep(forwardCostVector, forwardCostScalar.getDoubleValue());
cost += penalizeCandidateFootstep(backwardCostVector, backwardCostScalar.getDoubleValue());
cost += penalizeCandidateFootstep(inwardCostVector, inwardCostScalar.getDoubleValue());
cost += penalizeCandidateFootstep(outwardCostVector, outwardCostScalar.getDoubleValue());
cost += penalizeCandidateFootstep(upwardCostVector, upwardCostScalar.getDoubleValue());
cost += penalizeCandidateFootstep(downwardVector, downwardPenalizationWeightConsideringStancePitch);
cost += angularCostScalar.getDoubleValue() * Math.abs(idealToCandidateOrientation.getYaw().getDoubleValue());
cost += angularCostScalar.getDoubleValue() * Math.abs(idealToCandidateOrientation.getPitch().getDoubleValue());
cost += angularCostScalar.getDoubleValue() * Math.abs(idealToCandidateOrientation.getRoll().getDoubleValue());
cost += (1.0 - percentageOfFoothold) * negativeFootholdLinearCostScalar.getDoubleValue();
return cost;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void update(Tuple2DReadOnly currentPosition)
{
if (!hasBeenCalled.getBooleanValue())
{
hasBeenCalled.set(true);
lastPosition.set(currentPosition);
setToZero();
}
currentRawDerivative.sub(currentPosition, lastPosition);
currentRawDerivative.scale(1.0 / dt);
interpolate(currentRawDerivative, this, alphaProvider.getValue());
lastPosition.set(currentPosition);
}
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Gets the internal reference to the x-component used for this line direction.
*
* @return the direction x-component as {@code YoVariable}.
*/
public YoDouble getYoDirectionX()
{
return direction.getYoX();
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Gets the internal reference to the y-component used for this line direction.
*
* @return the direction y-component as {@code YoVariable}.
*/
public YoDouble getYoDirectionY()
{
return direction.getYoY();
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Creates a copy of {@code this} by finding the duplicated {@code YoVariable}s in the given
* {@link YoVariableRegistry}.
* <p>
* This method does not duplicate {@code YoVariable}s. Assuming the given registry is a duplicate
* of the registry that was used to create {@code this}, this method searches for the duplicated
* {@code YoVariable}s and use them to duplicate {@code this}.
* </p>
*
* @param newRegistry YoVariableRegistry to duplicate {@code this} to.
* @return the duplicate of {@code this}.
*/
public YoFrameLine2D duplicate(YoVariableRegistry newRegistry)
{
return new YoFrameLine2D(point.duplicate(newRegistry), direction.duplicate(newRegistry));
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public static BetaFilteredYoFrameVector2d createBetaFilteredYoFrameVector2d(String namePrefix, String nameSuffix, YoVariableRegistry registry, int beta, YoFrameVector2D unfilteredVector)
{
// beta is a int
BetaFilteredYoVariable x = new BetaFilteredYoVariable(YoFrameVariableNameTools.createXName(namePrefix, nameSuffix), registry, beta, unfilteredVector.getYoX());
BetaFilteredYoVariable y = new BetaFilteredYoVariable(YoFrameVariableNameTools.createYName(namePrefix, nameSuffix), registry, beta, unfilteredVector.getYoY());
BetaFilteredYoFrameVector2d ret = new BetaFilteredYoFrameVector2d(x, y, unfilteredVector.getReferenceFrame());
return ret;
}
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Creates a new {@code YoFrameLine2D} using the given {@code YoVariable}s and sets its reference
* frame to {@code referenceFrame}.
*
* @param pointX the variable to use for the x-coordinate of this line point.
* @param pointY the variable to use for the y-coordinate of this line point.
* @param directionX the variable to use for the x-component of this line direction.
* @param directionY the variable to use for the x-component of this line direction.
* @param referenceFrame the reference frame for this line.
*/
public YoFrameLine2D(YoDouble pointX, YoDouble pointY, YoDouble directionX, YoDouble directionY, ReferenceFrame referenceFrame)
{
point = new YoFramePoint2D(pointX, pointY, referenceFrame);
direction = new YoFrameVector2D(directionX, directionY, referenceFrame);
}
代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors
doPelvisAndChestYaw.set(true);
pelvisShiftScaleFactor = new YoFrameVector2D("DiagnosticPelvisShiftScaleFactor", null, registry);
pelvisShiftScaleFactor.set(0.4, 0.7);
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Creates a new {@code YoFrameLine2D} using the given {@code YoVariable}s and sets its reference
* frame to {@code referenceFrame}.
*
* @param point the {@code YoFramePoint2D} to use internally for this line point.
* @param direction the {@code YoFrameVector2D} to use internally for this line direction.
* @throws ReferenceFrameMismatchException if {@code point} and {@code direction} are not
* expressed in the same reference frame.
*/
public YoFrameLine2D(YoFramePoint2D point, YoFrameVector2D direction)
{
this(point.getYoX(), point.getYoY(), direction.getYoX(), direction.getYoY(), point.getReferenceFrame());
point.checkReferenceFrameMatch(direction);
}
代码示例来源:origin: us.ihmc/ihmc-footstep-planning
private void setXYVectorFromPoseToPoseNormalize(YoFrameVector2D vectorToPack, FramePose3D fromPose, FramePose3D toPose)
{
if (fromPose.getPosition().epsilonEquals(toPose.getPosition(), 1e-7))
{
vectorToPack.set(fromPose.getReferenceFrame(), 0.0, 0.0);
}
else
{
FrameVector2D frameTuple2d = new FrameVector2D(vectorToPack);
frameTuple2d.set(toPose.getPosition());
fromPose.checkReferenceFrameMatch(vectorToPack);
frameTuple2d.sub(fromPose.getX(), fromPose.getY());
frameTuple2d.normalize();
vectorToPack.set((Tuple2DReadOnly) frameTuple2d);
}
}
代码示例来源:origin: us.ihmc/ihmc-graphics-description
@Override
public YoArtifact duplicate(YoVariableRegistry newRegistry)
{
return new YoArtifactOval(getName(), center.duplicate(newRegistry), radii.duplicate(newRegistry), color);
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public static AccelerationLimitedYoFrameVector2d createAccelerationLimitedYoFrameVector2d(String namePrefix, String nameSuffix, YoVariableRegistry registry,
YoDouble maxRate, YoDouble maxAcceleration, double dt, YoFrameVector2D unfilteredVector)
{
AccelerationLimitedYoVariable x = new AccelerationLimitedYoVariable(YoFrameVariableNameTools.createXName(namePrefix, nameSuffix), registry, maxRate, maxAcceleration, unfilteredVector.getYoX(), dt);
AccelerationLimitedYoVariable y = new AccelerationLimitedYoVariable(YoFrameVariableNameTools.createYName(namePrefix, nameSuffix), registry, maxRate, maxAcceleration, unfilteredVector.getYoY(), dt);
AccelerationLimitedYoFrameVector2d ret = new AccelerationLimitedYoFrameVector2d(x, y, unfilteredVector.getReferenceFrame());
return ret;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public FilteredVelocityYoFrameVector2d(String namePrefix, String nameSuffix, DoubleProvider alpha, double dt, YoVariableRegistry registry,
ReferenceFrame referenceFrame)
{
super(namePrefix, nameSuffix, referenceFrame, registry);
this.alphaProvider = alpha;
this.dt = dt;
hasBeenCalled = new YoBoolean(namePrefix + nameSuffix + "HasBeenCalled", registry);
currentPosition = null;
lastPosition = new YoFrameVector2D(namePrefix + "_lastPosition", nameSuffix, getReferenceFrame(), registry);
reset();
}
代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit
public ActualCMPComputer(boolean createViz, SimulationConstructionSet scs, FloatingRootJointRobot simulatedRobot)
{
this.simulatedRobot = simulatedRobot;
simulateDT = scs.getDT();
gravity = simulatedRobot.getGravityZ();
momentumChange = FilteredVelocityYoFrameVector
.createFilteredVelocityYoFrameVector("rateOfChangeLinearMomentum", "", alpha, simulateDT, registry, yoLinearMomentum);
if (createViz)
{
yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoArtifactPosition cmpViz = new YoArtifactPosition("SimulationCMP", yoCmp.getYoX(), yoCmp.getYoY(), GraphicType.BALL_WITH_CROSS, Color.RED, 0.005);
cmpViz.setVisible(visibleByDefault);
yoGraphicsListRegistry.registerArtifact(getClass().getSimpleName(), cmpViz);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
}
else
{
yoGraphicsListRegistry = null;
}
}
for /f "tokens=*" %%a in ('find /v ":" "%appdata%\gamelauncher\options.txt" ^| find "menu=a"') do (
我在 Javascript 中有一组全局计数器变量: var counter_0 = 0; var counter_1 = 0; var counter_2 = 0; 等等 然后我有一个 Javasc
好的,我正在阅读一些有关 RedBlackTrees 的代码。我注意到这一行“v1 = v2 = v3 = v4;”我理解类似“v1 += v2”(将 v2 添加到 v1 的当前值)和“v1 = v2
我正在为 C# 中的游戏数据加载制作一个 csv 阅读器,我想做的就是从数组(变量)的值声明一个变量,我们可以在 php 中像 $$foo 那样做。喜欢 void csvReader(string s
假设我有变量 内容为“ 123 ”和变量 b123 里面有一些文字。出于某种原因,我想使用变量 作为第二个 var 名称的一部分。像这样的东西: SET a=123 SET b123=some_tex
我对 javascript 有点陌生,我无法通过谷歌搜索找到任何内容,我正在编写一个程序,并且能够执行我所要求的操作: if (Variable == 1 或 Variable == 2 或 Vari
我发现我自己在做这种类型的 IF 语句分配。例如: if($variable == 1 || $variable == "whatever" || $variable == '492') { ...
我的虚拟 PC 在 MS-DOS 6.22 上运行时出现问题。 我需要使用变量 Date ,但我无法得到它,因为每当我尝试回显变量时,它都会显示 %variable%反而。 我在 Windows 控制
尝试运行此代码时: List list = em.createQuery("select balance b from Users where b.userName = '" + user_name.
我有一些代码,其中变量可以是 undefined、null 或正常值。无论变量是 undefined 还是 null,代码都需要做同样的事情。说有没有危险 for (var cur = this.bu
我正在编写一个批处理命令脚本,其中检查环境变量。我需要通过传递所有必需的变量来编写一个 FOR 循环,然后验证它是否已定义,如果未定义,则提示该键的值并永久设置该变量。 问题是我无法取消引用循环变量并
我知道这些是 Rails 的基础知识,但我仍然不知道 = 符号和 => 之间的全部区别以及 @some_variable 之间的区别、@@some_variable 和 :some_variable
我正在使用以下内容创建一个动态变量(PHP 术语中的“变量变量”): foo: "test1" set to-word (rejoin [foo "_result_data"]) array 5 但是
我一直在啃 PHP 套接字服务器和客户端的基础知识 here . 然后我偶然发现了这些行(摘自上面链接的第一个示例,发生在 while 中): if (false === ($buf = socket
这个问题在这里已经有了答案: What does "|=" mean? (pipe equal operator) (6 个答案) 关闭 9 年前。 我正在寻找一些编码来扩展我在 Java 方面的知
如何在 C++ 中从其他变量的值打印变量我只是 C++ 的新手。 在 php 中,我们可以通过其他变量的值来制作/打印一个变量。像这样。 $example = 'foo'; $foo = 'abc';
作为 Ruby on Rails 新手,我明白“@”和“:”引用有不同的含义。我看到了this post在 SO 中,其中描述了一些差异。 @ 表示实例变量(例如@my_selection) :表示别
编程新手/甚至更新。一个小的 go 程序有问题 - 不会编译带有 undefined variable 错误。代码: package main import ( "fmt" "io" "o
我知道其他一些语言,如PHP,支持“变量变量名”的概念--即,字符串的内容可以用作变量名的一部分。。我听说总的来说这不是一个好主意,但我认为它可以解决我在Python代码中遇到的一些问题。。有没有可能
我有两个版本的代码。 版本 1 Launcher.java class Launcher { public static void main(String[] args) {
我是一名优秀的程序员,十分优秀!