예제 #1
0
 def _put_in_world_referential(orientation: float, cmd: Pose) -> Pose:
     if config['GAME']['on_negative_side']:
         cmd.position = rotate(cmd.position, -np.pi - orientation)
         cmd.x *= -1
         cmd.orientation *= -1
     else:
         cmd.position = rotate(cmd.position, orientation)
     return cmd
예제 #2
0
 def _put_in_robots_referential(robot: Robot, cmd: Pose) -> Pose:
     if config['GAME']['on_negative_side']:
         cmd.x *= -1
         cmd.orientation *= -1
         cmd.position = rotate(cmd.position, np.pi + robot.orientation)
     else:
         cmd.position = rotate(cmd.position, -robot.orientation)
     return cmd
예제 #3
0
def test_rotate_identity():
    assert rotate(A_POS, A_POS_ANGLE) is not A_POS
예제 #4
0
def test_rotate_by_negative_angle():
    assert rotate(A_POS, A_NEG_ANGLE) == A_POS_ROTATED_BY_A_NEG_ANGLE
예제 #5
0
def test_rotate_return_type():
    assert isinstance(rotate(A_POS, A_POS_ANGLE), Position)
예제 #6
0
def test_rotate_by_positive_angle():
    assert rotate(A_POS, A_POS_ANGLE) == A_POS_ROTATED_BY_A_POS_ANGLE
예제 #7
0
def test_rotate_identity():
    assert rotate(A_POS, A_POS_ANGLE) is not A_POS
예제 #8
0
def test_rotate_return_type():
    assert isinstance(rotate(A_POS, A_POS_ANGLE), Position)
예제 #9
0
def test_rotate_by_negative_angle():
    assert rotate(A_POS, A_NEG_ANGLE) == A_POS_ROTATED_BY_A_NEG_ANGLE
예제 #10
0
def test_rotate_by_positive_angle():
    assert rotate(A_POS, A_POS_ANGLE) == A_POS_ROTATED_BY_A_POS_ANGLE