cz.cuni.amis.pogamut.usar2004.samples.AirScanner
Class Obstacle

Package class diagram package Obstacle
java.lang.Object
  extended by cz.cuni.amis.pogamut.usar2004.samples.AirScanner.Obstacle

public class Obstacle
extends Object

Author:
vejmanm

Field Summary
static double joinDistance
           
static double maxEdgeSize
           
static double maxExtendRatio
           
static double obstacleSize
           
 
Constructor Summary
Obstacle(double centerX, double centerY)
           
Obstacle(math.geom2d.Point2D center)
          Initial constructor, center is the center of an obstacle, width and height is given by robot dimension(0.5).
Obstacle(math.geom2d.Point2D corner, double width, double height)
           
 
Method Summary
 boolean canExtend()
          If Obstacle grows only one dimension enough we don't want to extend it nomore.
 math.geom2d.Point2D getCorner()
           
 double getHeight()
           
 double getWidth()
           
 boolean isInside(double x, double y)
           
static Obstacle MergeObstacles(Obstacle blockA, Obstacle blockB)
           
 Obstacle tryExtend(double x, double y)
          If new Obstacle [x,y] is within the distance of joinDistance, i will extend this Obstacle boundbox by this point [x,y] plus its own boundbox of obstacleSize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

obstacleSize

public static final double obstacleSize
See Also:
Constant Field Values

joinDistance

public static final double joinDistance
See Also:
Constant Field Values

maxExtendRatio

public static final double maxExtendRatio
See Also:
Constant Field Values

maxEdgeSize

public static final double maxEdgeSize
See Also:
Constant Field Values
Constructor Detail

Obstacle

public Obstacle(math.geom2d.Point2D corner,
                double width,
                double height)

Obstacle

public Obstacle(math.geom2d.Point2D center)
Initial constructor, center is the center of an obstacle, width and height is given by robot dimension(0.5). From the center point it is computed the corner Point also.

Parameters:
center - Center of a new obstacle.

Obstacle

public Obstacle(double centerX,
                double centerY)
Method Detail

getWidth

public double getWidth()

getHeight

public double getHeight()

getCorner

public math.geom2d.Point2D getCorner()

tryExtend

public Obstacle tryExtend(double x,
                          double y)
If new Obstacle [x,y] is within the distance of joinDistance, i will extend this Obstacle boundbox by this point [x,y] plus its own boundbox of obstacleSize. If a small square is within the absorb region of this rectangle, it will enlarge itself to absorb this square so we don't need to create a new obstacle object.

Parameters:
x - x coordinate of new obstacle (Obstacle of a minimum size)
y - y coordinate of new obstacle (Obstacle of a minimum size)
Returns:
Returns Can = 1, Can not = -1 and is already inside = 0

canExtend

public boolean canExtend()
If Obstacle grows only one dimension enough we don't want to extend it nomore. It is good to have more smaller more accurate than fewer larger and sitorted obstacle boundboxes.

Returns:
Returns if obstacle is able to grow

isInside

public boolean isInside(double x,
                        double y)

MergeObstacles

public static Obstacle MergeObstacles(Obstacle blockA,
                                      Obstacle blockB)


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.