def test_yaw_logic(yaw, yaw_demand, expected): init_x, init_y, init_z, init_yaw = 0,0,0,0 AUV = Vehicle(0, 1, init_x, init_y, init_z, init_yaw) config = sim_config('config/sim_config.csv') AUV.set_yaw(yaw) AUV.set_yaw_demand(yaw_demand) AUV.plant(config.time_step) if expected ==1: assert AUV.yaw > yaw elif expected == 0: assert AUV.yaw < yaw
def test_yaw_logic(yaw, yaw_demand, expected): init_x, init_y, init_z, init_yaw = 0, 0, 0, 0 AUV = Vehicle(0, 1, init_x, init_y, init_z, init_yaw) config = sim_config('config/sim_config.csv') AUV.set_yaw(yaw) AUV.set_yaw_demand(yaw_demand) AUV.plant(config.time_step) if expected == 1: assert AUV.yaw > yaw elif expected == 0: assert AUV.yaw < yaw
def test_v(v, v_demand, expected): AUV = Vehicle(0, 1, 0, 0, 0, 0) config = sim_config('config/sim_config.csv') AUV.set_v(v) AUV.set_v_demand(v_demand) AUV.plant(config.time_step) if expected == 1: # assert AUV pitches nose down assert AUV.v > v elif expected == 0: # assert AUV pitches nose up assert AUV.v < v elif expected == 2: # assert AUV pitches nose up assert AUV.v == v
def test_pitch(start_loc, wayp, expected): AUV = Vehicle(0, 1, start_loc[0], start_loc[1], start_loc[2], 0) config = sim_config('config/sim_config.csv') AUV.waypoints = [wayp] AUV.current_waypoint = 0 AUV.move_to_waypoint() AUV.plant(config.time_step) if expected == 1: # assert AUV pitches nose down assert AUV.pitch > 0 elif expected == 0: # assert AUV pitches nose up assert AUV.pitch < 0 elif expected == 2: # assert AUV pitches nose up assert AUV.pitch == 0