ardupilot/Tools/autotest/pysim/testwind.py

21 lines
365 B
Python
Raw Normal View History

#!/usr/bin/env python
"""
simple test of wind generation code
"""
2016-11-08 07:06:05 -04:00
from __future__ import print_function
import time
import util
from pymavlink.rotmat import Vector3
2012-10-30 20:26:48 -03:00
wind = util.Wind('7,90,0.1')
t0 = time.time()
velocity = Vector3(0, 0, 0)
t = 0
deltat = 0.01
while t < 60:
2012-10-30 20:26:48 -03:00
print("%.4f %f" % (t, wind.drag(velocity, deltat=deltat).length()))
t += deltat