Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def recon_test(self, payload) -> None:
- home_captured = False
- armed = False
- takeoff = False
- land = False
- path_completed = False
- current_time = time.time()
- while not path_completed:
- if not home_captured:
- self.send_message(
- "avr/fcm/capture_home",
- {}
- )
- home_captured = True
- if not armed:
- self.send_message(
- "avr/fcm/actions",
- {"action": "arm", "payload": {}}
- )
- armed = True
- if not takeoff and time.time() - current_time > 1.0:
- self.send_message(
- "avr/fcm/actions",
- {"action": "takeoff", "payload": {"alt": 0.5}}
- )
- takeoff = True
- if not land and time.time() - current_time > 5.0:
- self.send_message(
- "avr/fcm/actions",
- {
- "action": "land",
- "payload": {}
- }
- )
- land = True
- path_completed = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement