fork(913) download
  1. from plot import plot
  2.  
  3. class UserCode:
  4. def __init__(self):
  5. # initialize data you want to store in this object between calls to the measurement_callback() method
  6. self.last_yaw = 0
  7.  
  8. def measurement_callback(self, t, dt, navdata):
  9. yaw_vel = (navdata.rotZ - self.last_yaw) / dt
  10. self.last_yaw = navdata.rotZ
  11.  
  12.  
  13. '''
  14. :param t: time since simulation start
  15. :param dt: time since last call to measurement_callback
  16. :param navdata: measurements of the quadrotor
  17. '''
  18.  
  19. # add your plot commands here
  20. plot("roll", navdata.rotX);
  21. plot("pitch", navdata.rotX);
  22. plot("yaw", navdata.rotZ)
  23. plot("vx", navdata.vx)
  24. plot("vy", navdata.vy)
  25. plot("yaw velocity", yaw_vel)
Runtime error #stdin #stdout #stderr 0.01s 7688KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 1, in <module>
ImportError: No module named plot