Guest User

Untitled

a guest
Nov 14th, 2021
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MessageHolder:
  2. def __init__(self, target_x=0, x=0, target_y=0, y=0, target_z=0, z=0):
  3. self.target_x = target_x
  4. self.x = x
  5. self.target_y = target_y
  6. self.y = y
  7. self.target_z = target_z
  8. self.z = z
  9.  
  10. #this part is not working at all
  11. @vehicle.on_message('POSITION_TARGET_LOCAL_NED')
  12. def listener_position_target_local_ned(self, name, message):
  13. message_holder.target_x = message.x
  14. message_holder.target_y = message.y
  15. message_holder.target_z = message.z
  16.  
  17. #this part works great
  18. @vehicle.on_message('LOCAL_POSITION_NED')
  19. def listener_local_position_ned(self, name, message):
  20. message_holder.x = message.x
  21. message_holder.y = message.y
  22. message_holder.z = message.z
  23.  
  24.  
RAW Paste Data