us.ihmc.robotics.math.frames.YoFrameLineSegment2d类的使用及代码示例

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

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

YoFrameLineSegment2d介绍

[英]Note: You should only make these once at the initialization of a controller. You shouldn't make any on the fly since they contain YoVariables.
[中]注意:在控制器初始化时,只应执行一次。你不应该在飞行中做任何事情,因为它们包含变量。

代码示例

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

private YoArtifactLineSegment2d(String name, DoubleYoVariable startX, DoubleYoVariable startY, DoubleYoVariable endX, DoubleYoVariable endY, Color color, double arrowHeadWidth, double arrowHeadHeight)
{
 this(name, new YoFrameLineSegment2d(startX, startY, endX, endY, ReferenceFrame.getWorldFrame()), color, arrowHeadWidth, arrowHeadHeight);
}

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

public boolean areEndpointsTheSame()
{
 return LineSegment2d.areEndpointsTheSame(getFirstEndpointX(), getFirstEndpointY(), getSecondEndpointX(), getSecondEndpointY());
}

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

public YoArtifactLineSegment2d(String name, YoFrameLineSegment2d lineSegment, Color color)
{
 super(name, new double[0], color,
    lineSegment.getYoFirstEndpointX(), lineSegment.getYoFirstEndpointY(), lineSegment.getYoSecondEndpointX(), lineSegment.getYoSecondEndpointY());
 this.lineSegment = lineSegment;
 this.drawArrow = false;
}

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

graphics.setStroke(STROKE);
if (lineSegment.areEndpointsTheSame())
  tempFirstEndpoint.set(lineSegment.getFirstEndpointX(), lineSegment.getFirstEndpointY());
  graphics.drawPoint(tempFirstEndpoint);
  lineSegment.getFrameLineSegment2d().get(tempLineSegment);
  graphics.drawLineSegment(tempLineSegment);
  arrowHeadVector.set(lineSegment.getSecondEndpointX() - lineSegment.getFirstEndpointX(), lineSegment.getSecondEndpointY() - lineSegment.getFirstEndpointY());
  arrowHeadVector.normalize();
  arrowHeadLateralVector.set(arrowHeadVector.getY(), -arrowHeadVector.getX());
  arrowHeadLateralVector.scale(arrowHeadWidth / 2.0);
  tempArrowPolygon.getVertex(0).set(lineSegment.getSecondEndpointX(), lineSegment.getSecondEndpointY());
  tempArrowPolygon.getVertex(1).set(lineSegment.getSecondEndpointX(), lineSegment.getSecondEndpointY());
  tempArrowPolygon.getVertex(1).sub(arrowHeadVector);
  tempArrowPolygon.getVertex(1).sub(arrowHeadLateralVector);
  tempArrowPolygon.getVertex(2).set(lineSegment.getSecondEndpointX(), lineSegment.getSecondEndpointY());
  tempArrowPolygon.getVertex(2).sub(arrowHeadVector);
  tempArrowPolygon.getVertex(2).add(arrowHeadLateralVector);

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

public boolean containsNaN()
{
 return Double.isNaN(getFirstEndpointX()) || Double.isNaN(getFirstEndpointY()) || Double.isNaN(getSecondEndpointX()) || Double.isNaN(getSecondEndpointY());
}

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

public YoArtifactLineSegment2d(String name, YoFrameLineSegment2d lineSegment, Color color, double arrowHeadWidth, double arrowHeadHeight)
{
 super(name, new double[0], color,
    lineSegment.getYoFirstEndpointX(), lineSegment.getYoFirstEndpointY(), lineSegment.getYoSecondEndpointX(), lineSegment.getYoSecondEndpointY());
 this.lineSegment = lineSegment;
 this.drawArrow = true;
 instatiateArrowObjects(arrowHeadWidth, arrowHeadHeight);
}

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

@Override
public Artifact createArtifact()
{
 Color3f color3f = appearance.getColor();
 return new YoArtifactLineSegment2d(getName(), new YoFrameLineSegment2d(baseX, baseY, x, y, ReferenceFrame.getWorldFrame()), new Color(color3f.getX(), color3f.getY(), color3f.getZ()));
}

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

public SimpleDesiredHeadingControlModuleVisualizer(ProcessedSensorsInterface processedSensors, YoVariableRegistry registry,
   YoGraphicsListRegistry yoGraphicsListRegistry)
{
 this.processedSensors = processedSensors;
 desiredHeadingLine = new YoFrameLineSegment2d("desiredHeadingLine", "", ReferenceFrame.getWorldFrame(), registry);
 finalHeadingLine = new YoFrameLineSegment2d("finalHeadingLine", "", ReferenceFrame.getWorldFrame(), registry);
 if (yoGraphicsListRegistry != null)
 {
   ArtifactList artifactList = new ArtifactList("Simple Desired Heading");
   YoArtifactLineSegment2d yoFrameLineSegment2dArtifact = new YoArtifactLineSegment2d("Desired Heading Line", desiredHeadingLine, Color.MAGENTA);
   artifactList.add(yoFrameLineSegment2dArtifact);
   yoFrameLineSegment2dArtifact = new YoArtifactLineSegment2d("Final Heading Line", finalHeadingLine, Color.ORANGE);
   artifactList.add(yoFrameLineSegment2dArtifact);
   yoGraphicsListRegistry.registerArtifactList(artifactList);
 }
}

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

public YoArtifactLineSegment2d(String name, YoFramePoint2d start, YoFramePoint2d end, Color color)
{
 this(name, new YoFrameLineSegment2d(start.getYoX(), start.getYoY(), end.getYoX(), end.getYoY(), ReferenceFrame.getWorldFrame()), color);
}

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

YoFrameLineSegment2d segment = new YoFrameLineSegment2d((DoubleYoVariable) vars[0], (DoubleYoVariable) vars[1], (DoubleYoVariable) vars[2], (DoubleYoVariable) vars[3],
   ReferenceFrame.getWorldFrame());

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

yoLineOfRotation = new YoFrameLineSegment2d(caption, "", "", worldFrame, registry);
YoArtifactLineSegment2d lineOfRotationArtifact =
   new YoArtifactLineSegment2d(caption, yoLineOfRotation, Color.GREEN, 0.01, 0.01);

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

yoCoRVelocityAlphaFilter, dt, registry, yoCoRPositionFiltered);
yoLineOfRotation = new YoFrameLineSegment2d(namePrefix + "LoRPosition", "", generalDescription, worldFrame, registry);
yoAngleOfLoR = new DoubleYoVariable(namePrefix + "AngleOfLoR", generalDescription, registry);
yoLoRAngularVelocityAlphaFilter = new DoubleYoVariable(namePrefix + "LoRAngularVelocityAlphaFilter", generalDescription, registry);

相关文章