Ejemplo n.º 1
0
def testRouteNothingToDo():
    origin = navigation.Coordinate(0, 0, 30)
    destination = navigation.Coordinate(0, 0, 30)

    result = navigation.Terrain().plotRouteFromTo(origin, destination)

    assert len(result) == 0
Ejemplo n.º 2
0
def testRouteNoDistance():
    origin = navigation.Coordinate(0, 0, 30)
    destination = navigation.Coordinate(0, 0, 0)

    result = navigation.Terrain().plotRouteFromTo(origin, destination)

    assert len(result) == 1
    assert result[0] == navigation.RouteStep(navigation.RouteStep.TURN, -30)
Ejemplo n.º 3
0
def testRouteFromSouth():
    origin = navigation.Coordinate(0, -50, 30)
    destination = navigation.Coordinate(0, 0, 0)

    result = navigation.Terrain().plotRouteFromTo(origin, destination)

    assert len(result) == 2
    assert result[0] == navigation.RouteStep(navigation.RouteStep.TURN, -30)
    assert result[1] == navigation.RouteStep(navigation.RouteStep.DRIVE, 50)
Ejemplo n.º 4
0
def testRouteFromEast():
    origin = navigation.Coordinate(50, 0, 30)
    destination = navigation.Coordinate(0, 0, 0)

    result = navigation.Terrain().plotRouteFromTo(origin, destination)

    assert len(result) == 3
    print(str(result[0]))
    assert result[0] == navigation.RouteStep(navigation.RouteStep.TURN, -120)
    assert result[1] == navigation.RouteStep(navigation.RouteStep.DRIVE, 50)
    assert result[2] == navigation.RouteStep(navigation.RouteStep.TURN, -270)
Ejemplo n.º 5
0
def testRouteFromSouthWest():
    origin = navigation.Coordinate(-10, -10, 30)
    destination = navigation.Coordinate(30, 20, 20)

    result = navigation.Terrain().plotRouteFromTo(origin, destination)

    assert len(result) == 3
    print(str(result[0]))
    assert result[0] == navigation.RouteStep(navigation.RouteStep.TURN, -337)
    assert result[1] == navigation.RouteStep(navigation.RouteStep.DRIVE, 50)
    assert result[2] == navigation.RouteStep(navigation.RouteStep.TURN, -33)
Ejemplo n.º 6
0
def testRouteFromNorthEast():
    origin = navigation.Coordinate(80, 60, 30)
    destination = navigation.Coordinate(40, 30, 20)

    result = navigation.Terrain().plotRouteFromTo(origin, destination)

    assert len(result) == 3
    print(str(result[0]))
    assert result[0] == navigation.RouteStep(navigation.RouteStep.TURN, -157)
    assert result[1] == navigation.RouteStep(navigation.RouteStep.DRIVE, 50)
    assert result[2] == navigation.RouteStep(navigation.RouteStep.TURN, -213)