us.ihmc.robotics.quadTree.Box.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(156)

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

Box.<init>介绍

暂无

代码示例

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

public QuadTreeForGroundNode(String id, double minX, double minY, double maxX, double maxY, QuadTreeForGroundParameters parameters, QuadTreeForGroundPointLimiter decay, QuadTreeForGroundNode parent, double defaultHeightWhenNoPonts, 
             ArrayList<QuadTreeForGroundListener> listeners)
{
 this(id, new Box(minX, minY, maxX, maxY), parameters, decay, parent, defaultHeightWhenNoPonts, listeners);
}

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

public Box scale(double scaleX, double scaleY)
{
 scaleY *= this.centreY - this.minY;
 scaleX *= this.centreX - this.minX;
 return new Box(this.minX - scaleX, this.minY - scaleY, this.maxX + scaleX, this.maxY + scaleY);
}

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

public QuadTreeForGroundNode(String id, double minX, double minY, double maxX, double maxY, QuadTreeForGroundParameters parameters, QuadTreeForGroundPointLimiter decay, QuadTreeForGroundNode parent, double defaultHeightWhenNoPonts, 
             ArrayList<QuadTreeForGroundListener> listeners)
{
 this(id, new Box(minX, minY, maxX, maxY), parameters, decay, parent, defaultHeightWhenNoPonts, listeners);
}

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

public Box scale(double scaleX, double scaleY)
{
 scaleY *= this.centreY - this.minY;
 scaleX *= this.centreX - this.minX;
 return new Box(this.minX - scaleX, this.minY - scaleY, this.maxX + scaleX, this.maxY + scaleY);
}

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

public Box intersection(Box r)
{
 double tempX1 = this.minX;
 double tempY1 = this.minY;
 double tempX2 = this.maxX;
 double tempY2 = this.maxY;
 if (this.minX < r.minX)
 {
   tempX1 = r.minX;
 }
 if (this.minY < r.minY)
 {
   tempY1 = r.minY;
 }
 if (tempX2 > r.maxX)
 {
   tempX2 = r.maxX;
 }
 if (tempY2 > r.maxY)
 {
   tempY2 = r.maxY;
 }
 if (tempX2 - tempX1 <= 0.f || tempY2 - tempY1 <= 0.f)
 {
   return null;
 }
 return new Box(tempX1, tempY1, tempX2, tempY2);
}

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

public Box union(Box b)
{
 return new Box(Math.min(this.minX, b.minX), Math.min(this.minY, b.minY), Math.max(this.maxX, b.maxX), Math.max(this.maxY, b.maxY));
}

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

public Box union(Box b)
{
 return new Box(Math.min(this.minX, b.minX), Math.min(this.minY, b.minY), Math.max(this.maxX, b.maxX), Math.max(this.maxY, b.maxY));
}

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

public QuadTreeForGround(double minX, double minY, double maxX, double maxY, double resolution, double heightThreshold,
             double maxMultiLevelZChangeToFilterNoise, int maxSameHeightPointsPerNode,
             double maxAllowableXYDistanceForAPointToBeConsideredClose)
{
 this(new Box(minX, minY, maxX, maxY), new QuadTreeForGroundParameters(resolution, heightThreshold, maxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode,
    maxAllowableXYDistanceForAPointToBeConsideredClose, -1));
}

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

public QuadTreeForGround(double minX, double minY, double maxX, double maxY, double resolution, double heightThreshold,
             double maxMultiLevelZChangeToFilterNoise, int maxSameHeightPointsPerNode,
             double maxAllowableXYDistanceForAPointToBeConsideredClose)
{
 this(new Box(minX, minY, maxX, maxY), new QuadTreeForGroundParameters(resolution, heightThreshold, maxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode,
    maxAllowableXYDistanceForAPointToBeConsideredClose, -1));
}

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

public static QuadTreeForGroundHeightMap setupGroundOnlyQuadTree(DepthDataFilterParameters parameters)
{
 Box bounds = new Box(-QUAD_TREE_EXTENT, -QUAD_TREE_EXTENT, QUAD_TREE_EXTENT, QUAD_TREE_EXTENT);
 QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(DepthDataFilterParameters.GRID_RESOLUTION,
    parameters.quadtreeHeightThreshold, parameters.quadTreeMaxMultiLevelZChangeToFilterNoise, parameters.maxSameHeightPointsPerNode,
    parameters.maxAllowableXYDistanceForAPointToBeConsideredClose, parameters.maximumNumberOfPoints);
 return new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);
}

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

public static QuadTreeForGroundHeightMap setupGroundOnlyQuadTree(DepthDataFilterParameters parameters)
{
 Box bounds = new Box(-QUAD_TREE_EXTENT, -QUAD_TREE_EXTENT, QUAD_TREE_EXTENT, QUAD_TREE_EXTENT);
 QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(DepthDataFilterParameters.GRID_RESOLUTION,
    parameters.quadtreeHeightThreshold, parameters.quadTreeMaxMultiLevelZChangeToFilterNoise, parameters.maxSameHeightPointsPerNode,
    parameters.maxAllowableXYDistanceForAPointToBeConsideredClose, parameters.maximumNumberOfPoints);
 return new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0, categoriesOverride = IntegrationCategory.EXCLUDE)
@Test(timeout = 30000)
public void testGetAllPoints()
{
 QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(0.01, Double.MAX_VALUE, Double.MAX_VALUE, Integer.MAX_VALUE, 0.0, -1);
 QuadTreeForGround tree = new QuadTreeForGround(new Box(-1, -1, 1, 1), quadTreeParameters);
 Collection<Point3D> points = new ArrayList<>();
 //ensure 
 for (double x = -0.5; x < 0.5; x += quadTreeParameters.getResolution() * 2)
 {
   for (double y = -0.5; y < 0.5; y += quadTreeParameters.getResolution() * 2)
   {
    final double z = 0.1;
    Point3D p = new Point3D(x, y, z);
    points.add(p);
    tree.put(x, y, 0.1);
   }
 }
 ArrayList<Point3D> retrievedPoints = new ArrayList<>();
 tree.getStoredPoints(retrievedPoints);
 assertTrue(points.containsAll(retrievedPoints));
}

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

@Override
public List<Point3d> getAllPointsWithinArea(double xCenter, double yCenter, double xExtent, double yExtent,
    InclusionFunction<Point3d> maskFunctionAboutCenter)
{
 ArrayList<Point3d> pointsWithinBoundsToPack = new ArrayList<Point3d>();
 ArrayList<Point3d> filteredPoints = new ArrayList<Point3d>();
 lock();
 Box bounds = new Box(xCenter - xExtent, yCenter - yExtent, xCenter + xExtent, yCenter + yExtent);
 super.getAllPointsWithinBounds(bounds, pointsWithinBoundsToPack);
 maskList(pointsWithinBoundsToPack, maskFunctionAboutCenter, filteredPoints);
 // TODO: Magic number 10. Get rid of it somehow...
 if (filteredPoints.size() > 10)
 {
   unlock();
   return filteredPoints;
 }
 // If not enough raw points, then use the heightAt function to do the best you can
 filteredPoints.clear();
 ArrayList<Point3d> pointsAtGridResolution = getPointsAtGridResolution(xCenter, yCenter, xExtent, yExtent);
 maskList(pointsAtGridResolution, maskFunctionAboutCenter, filteredPoints);
 unlock();
 return filteredPoints;
}

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

public HeightQuadTreeToolboxController(FullHumanoidRobotModel fullRobotModel, CommandInputManager commandInputManager,
                   StatusMessageOutputManager statusOutputManager, YoVariableRegistry parentRegistry)
{
 super(statusOutputManager, parentRegistry);
 this.fullRobotModel = fullRobotModel;
 rootJoint = fullRobotModel.getRootJoint();
 this.commandInputManager = commandInputManager;
 oneDoFJoints = FullRobotModelUtils.getAllJointsExcludingHands(fullRobotModel);
 ForceSensorDefinition[] forceSensorDefinitions = fullRobotModel.getForceSensorDefinitions();
 IMUDefinition[] imuDefinitions = fullRobotModel.getIMUDefinitions();
 expectedRobotConfigurationDataHash = RobotConfigurationDataFactory.calculateJointNameHash(oneDoFJoints, forceSensorDefinitions, imuDefinitions);
 Box bounds = new Box(-QUAD_TREE_EXTENT, -QUAD_TREE_EXTENT, QUAD_TREE_EXTENT, QUAD_TREE_EXTENT);
 QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(RESOLUTION, quadtreeHeightThreshold,
                                          quadTreeMaxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode,
                                          maxAllowableXYDistanceForAPointToBeConsideredClose,
                                          maximumNumberOfPoints);
 quadTree = new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);
}

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

public HeightQuadTreeToolboxController(FullHumanoidRobotModel fullRobotModel, PacketCommunicator packetCommunicator, CommandInputManager commandInputManager,
   StatusMessageOutputManager statusOutputManager, YoVariableRegistry parentRegistry)
{
 super(statusOutputManager, parentRegistry);
 this.fullRobotModel = fullRobotModel;
 this.packetCommunicator = packetCommunicator;
 rootJoint = fullRobotModel.getRootJoint();
 this.commandInputManager = commandInputManager;
 oneDoFJoints = FullRobotModelUtils.getAllJointsExcludingHands(fullRobotModel);
 ForceSensorDefinition[] forceSensorDefinitions = fullRobotModel.getForceSensorDefinitions();
 IMUDefinition[] imuDefinitions = fullRobotModel.getIMUDefinitions();
 expectedRobotConfigurationDataHash = RobotConfigurationData.calculateJointNameHash(oneDoFJoints, forceSensorDefinitions, imuDefinitions);
 Box bounds = new Box(-QUAD_TREE_EXTENT, -QUAD_TREE_EXTENT, QUAD_TREE_EXTENT, QUAD_TREE_EXTENT);
 QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(RESOLUTION, quadtreeHeightThreshold,
    quadTreeMaxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode, maxAllowableXYDistanceForAPointToBeConsideredClose, maximumNumberOfPoints);
 quadTree = new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);
}

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

public void nodeAdded(String id, OneDimensionalBounds[] bounds, HyperCubeLeaf<Boolean> leaf)
{
 Box boundryBox = new Box(bounds[0].min(), bounds[1].min(), bounds[0].max(), bounds[1].max());
 if (leaf != null)
   if (leaf.getValue())
    quadListener.nodeAdded(id, boundryBox, (float) leaf.getLocation()[0], (float) leaf.getLocation()[1], (float) leaf.getLocation()[2]);
}

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

public void nodeAdded(String id, OneDimensionalBounds[] bounds, HyperCubeLeaf<Boolean> leaf)
{
 Box boundryBox = new Box(bounds[0].min(), bounds[1].min(), bounds[0].max(), bounds[1].max());
 if (leaf != null)
   if (leaf.getValue())
    quadListener.nodeAdded(id, boundryBox, (float) leaf.getLocation()[0], (float) leaf.getLocation()[1], (float) leaf.getLocation()[2]);
}

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

public void createHeightMap(ArrayList<Point3D> listOfPoints, BoundingBox2D testingRange, double resolution, double heightThreshold,
              double quadTreeMaxMultiLevelZChangeToFilterNoise, int maxSameHeightPointsPerNode,
              double maxAllowableXYDistanceForAPointToBeConsideredClose, int maxNodes)
{
  double minX = testingRange.getMinPoint().getX();
  double maxX = testingRange.getMaxPoint().getX();
  double minY = testingRange.getMinPoint().getY();
  double maxY = testingRange.getMaxPoint().getY();
  Box bounds = new Box(minX, minY, maxX, maxY);
  QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(resolution, heightThreshold,
                            quadTreeMaxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode,
                            maxAllowableXYDistanceForAPointToBeConsideredClose, -1);
  heightMap = new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);
  for (Point3D point : listOfPoints)
  {
   heightMap.addPoint(point.getX(), point.getY(), point.getZ());
  }
}

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

public HeightMapWithPoints createHeightMap(ArrayList<Point3D> listOfPoints, BoundingBox2D testingRange, double resolution, double heightThreshold,
   double quadTreeMaxMultiLevelZChangeToFilterNoise, int maxSameHeightPointsPerNode, double maxAllowableXYDistanceForAPointToBeConsideredClose,
   int maxNodes)
{
 double minX = testingRange.getMinPoint().getX();
 double maxX = testingRange.getMaxPoint().getX();
 double minY = testingRange.getMinPoint().getY();
 double maxY = testingRange.getMaxPoint().getY();
 Box bounds = new Box(minX, minY, maxX, maxY);
 QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(resolution, heightThreshold, quadTreeMaxMultiLevelZChangeToFilterNoise,
    maxSameHeightPointsPerNode, maxAllowableXYDistanceForAPointToBeConsideredClose, -1);
 QuadTreeForGroundHeightMap heightMap = new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);
 for (Point3D point : listOfPoints)
 {
   heightMap.addPoint(point.getX(), point.getY(), point.getZ());
 }
 return heightMap;
}

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

public static QuadTreeForGroundHeightMap createHeightMap(ArrayList<Point3d> listOfPoints, BoundingBox2d testingRange, double resolution, double heightThreshold,
                double quadTreeMaxMultiLevelZChangeToFilterNoise, int maxSameHeightPointsPerNode,
                double maxAllowableXYDistanceForAPointToBeConsideredClose, int maxNodes)
  {
   double minX = testingRange.getMinPoint().getX();
   double maxX = testingRange.getMaxPoint().getX();
   double minY = testingRange.getMinPoint().getY();
   double maxY = testingRange.getMaxPoint().getY();

   Box bounds = new Box(minX, minY, maxX, maxY);
   QuadTreeForGroundParameters quadTreeParameters = new QuadTreeForGroundParameters(resolution, heightThreshold,
      quadTreeMaxMultiLevelZChangeToFilterNoise, maxSameHeightPointsPerNode,
      maxAllowableXYDistanceForAPointToBeConsideredClose, -1);

   QuadTreeForGroundHeightMap heightMap = new QuadTreeForGroundHeightMap(bounds, quadTreeParameters);

   for (Point3d point : listOfPoints)
   {
     heightMap.addPoint(point.getX(), point.getY(), point.getZ());
   }

   return heightMap;
  }
}

相关文章