def test_configure_objects(self): sim_runner = runner.SimRunner() x_pos, y_pos, z_pos, r_rot, p_rot, y_rot = 0, 0, 0, 0, 0, 0 sim_object1 = object.SimObject("", const.POLE_MODEL, x_pos, y_pos, z_pos, r_rot, p_rot, y_rot) sim_object2 = object.SimObject("", const.POOL_MODEL, x_pos, y_pos, z_pos, r_rot, p_rot, y_rot) obj_nodes = sim_runner._configure_objects([sim_object1, sim_object2]) assert len(obj_nodes) == 2
def test_configure_data(self): tree = xmltree.parse(lib_path + "/uwsim/xml/vehicle.xml") root = tree.getroot() data = dict() data[const.VEHICLE_X_POS] = 100 data[const.VEHICLE_Y_POS] = -100 data[const.VEHICLE_Z_POS] = 100 sim_runner = runner.SimRunner() nodes = sim_runner._configure_data(root, data) for elem in data: path = list(elem.split(",")) val = data[elem] target = root for node in path: target = target.find(node) assert target.text == str(val)
def test_all_processes_and_exit(self): sim_runner = runner.SimRunner() sim_runner._launch_vehicle_ai() sim_runner._launch_dynamics() sim_runner.run_simulation(10) sim_runner.exit()
def test_stop_simulation(self): sim_runner = runner.SimRunner() sim_runner._launch_dynamics() sim_runner.run_simulation(10) sim_runner.stop_simulation()
def test_setup(self): sim_runner = runner.SimRunner() sim_runner.setup() sim_runner.exit()