def test_collisions(): L = 10 world = Box(L, L) # id_vehicle = 'd_SE2_rb_v-rf360' id_vehicle = 'd_SE2_rb_v-random_5' get_vehicles_config().load('default') vehicles = get_conftools_vehicles() # vehicles.load('default') vehicle = vehicles.instance(id_vehicle) # @UndefinedVariable vehicle.set_world_primitives(world.get_primitives()) vehicle.set_pose(SE3.identity()) commands = np.array([1, 0, 0]) # go straight simulation_length = 10 dt = 0.1 time = 0 steps = int(np.ceil(simulation_length / dt)) for _ in range(steps): vehicle.simulate(commands, dt) pose = SE2_from_SE3(vehicle.get_pose()) translation = translation_from_SE2(pose) # print('t=%.3f %s' % (time, SE2.friendly(pose))) time += dt assert translation[0] <= 9.5 assert translation[0] >= 9.4 assert translation[1] == 0
def get_comptests(): # get testing configuration directory from pkg_resources import resource_filename # @UnresolvedImport dirname = resource_filename("vehicles_boot", "configs") from vehicles import get_vehicles_config get_vehicles_config().load('default') # load into bootstrapping_olympics from comptests import get_comptests_app from bootstrapping_olympics import get_boot_config boot_config = get_boot_config() boot_config.load(dirname) # Our tests are its tests with our configuration import bootstrapping_olympics return bootstrapping_olympics.get_comptests()