-
Notifications
You must be signed in to change notification settings - Fork 110
/
pix-showdata.py
46 lines (38 loc) · 1.25 KB
/
pix-showdata.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
""" Drone Pilot - Control of MRUAV """
""" pix-showdata.py -> Script that shows data from a vehicle. DroneKit 2.0 related. """
__author__ = "Aldo Vargas"
__copyright__ = "Copyright 2016 Altax.net"
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Aldo Vargas"
__email__ = "[email protected]"
__status__ = "Development"
import time
from dronekit import connect, VehicleMode
import modules.UDPserver as udp
from modules.utils import *
from modules.pixVehicle import *
# Connection to the vehicle
# SITL via TCP
#vehicle = connect('tcp:127.0.0.1:5760', wait_ready=True)
# SITL via UDP
vehicle = connect('udp:127.0.0.1:14549', wait_ready=True)
# Real vehicle via Serial Port
#vehicle = connect('/dev/tty.usbmodem1', wait_ready=False)
while True:
print "%s" % vehicle.attitude #SR2_EXTRA1
print "%s" % vehicle.velocity #SR2_POSITION
print "%s" % vehicle.channels #SR2_RC_CHAN
print "Altitude (global frame): %s" % vehicle.location.global_frame.alt
print "Altitude (global relative frame): %s" % vehicle.location.global_relative_frame.alt
print "%s" % vehicle.mode.name
#print "%s" % udp.message
time.sleep(0.01)
vehicle.close()
'''
param set SR2_EXTRA1 50
param set SR2_POSITION 50
param set SR2_RAW_CTRL 50
param set SR2_RC_CHAN 50
'''