예제 #1
0
 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
예제 #2
0
 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)
예제 #3
0
 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()
예제 #4
0
 def test_stop_simulation(self):
     sim_runner = runner.SimRunner()
     sim_runner._launch_dynamics()
     sim_runner.run_simulation(10)
     sim_runner.stop_simulation()
예제 #5
0
 def test_setup(self):
     sim_runner = runner.SimRunner()
     sim_runner.setup()
     sim_runner.exit()