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_pitch_yaw(z, yaw, pitch, expected): init_x, init_y = 0,0 # (self,i, Swarm_Size, start_x, start_y, start_z, start_yaw) AUV = Vehicle(0, 1, init_x, init_y, z, yaw) config = sim_config('config/sim_config.csv') AUV.set_yaw(yaw) AUV.set_pitch(pitch) AUV.dead_reckoner(config.time_step) x = expected[0] y = expected[1] z = expected[2] assert abs(AUV.x - x) < 0.0000001 assert abs(AUV.y - y) < 0.0000001 assert abs(AUV.z - z) < 0.0000001
def test_pitch_yaw(z, yaw, pitch, expected): init_x, init_y = 0, 0 # (self,i, Swarm_Size, start_x, start_y, start_z, start_yaw) AUV = Vehicle(0, 1, init_x, init_y, z, yaw) config = sim_config('config/sim_config.csv') AUV.set_yaw(yaw) AUV.set_pitch(pitch) AUV.dead_reckoner(config.time_step) x = expected[0] y = expected[1] z = expected[2] assert abs(AUV.x - x) < 0.0000001 assert abs(AUV.y - y) < 0.0000001 assert abs(AUV.z - z) < 0.0000001