Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GPS in flight GUI #2

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
be33e2c
Update flight_gui.py
Mart4672 Feb 2, 2020
bbdf6c3
Create flight_gui.asv
Mart4672 Feb 2, 2020
8953040
Merge branch 'master' into UI_Testing
Mart4672 Feb 2, 2020
6e4a92d
Update flight_gui.py
Mart4672 Feb 2, 2020
a905974
Update flight_gui.py
Mart4672 Feb 3, 2020
d842f90
Update flight_gui.py
Mart4672 Feb 3, 2020
f60b56e
Delete flight_gui.asv
Mart4672 Feb 3, 2020
706e833
Update flight_gui.py
Mart4672 Feb 3, 2020
fa6bd2e
Update flight_gui.py
Mart4672 Feb 16, 2020
6aa45ed
added vb1 variable
Mart4672 Mar 6, 2020
e4e5f50
UI additions for testing pyro channels
Mart4672 Mar 9, 2020
8409e46
Update flight_gui.py
Mart4672 Mar 9, 2020
a35f933
units, minor fixes
Mart4672 Mar 10, 2020
86735eb
Update flight_gui.py
Mart4672 Mar 14, 2020
aebcc34
reset button, plots, new data types
Mart4672 Mar 15, 2020
974253d
Merge branch 'master' into UI_Testing
krame505 Mar 15, 2020
e23914b
Rescale plots size
krame505 Mar 15, 2020
d197498
bg
Mart4672 Mar 15, 2020
61974f4
Merge branch 'UI_Testing' of https://github.com/LPRD/TelemetryControl…
Mart4672 Mar 15, 2020
bd0c63f
Merge branch 'master' into UI_Testing
krame505 Mar 16, 2020
4a3c40a
Merge branch 'master' into UI_Testing
krame505 Mar 16, 2020
b41a304
bg colors and positioning
Mart4672 Mar 17, 2020
d076883
Avoid setting the background colors globally
krame505 Mar 18, 2020
b7a04dc
old changes that I forgot to update
Mart4672 Apr 13, 2020
49913ea
Merge branch 'UI_Testing' of https://github.com/LPRD/TelemetryControl…
Mart4672 Apr 13, 2020
403a618
Minor Fixes
Mart4672 Jul 7, 2020
49b1a44
compatability testing
Mart4672 Jul 19, 2020
25ca917
Revert "compatability testing"
Mart4672 Jul 19, 2020
c76e875
Clean Slate Start Point
Mart4672 Jul 19, 2020
1ebdc75
Fixed Start Button
Mart4672 Jul 19, 2020
ff7d6bf
Updated dist files
krame505 Aug 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions drivers/flight_gui.asv
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python3
krame505 marked this conversation as resolved.
Show resolved Hide resolved

import sys
sys.path.append("src")

from tkinter import *

import manager
import gui
import plot

def vector_DataType(name, *args, **kwd_args):
data_types = [manager.DataType(d + "_" + name, *args, **kwd_args) for d in ['x', 'y', 'z']]
data_types.append(manager.PacketSpec(name, *data_types))
return data_types

def vector_Plot(x, y, name=None, *args, **kwd_args):
if name == None:
name = y.replace("_", " ")
return plot.Plot(x, [d + "_" + y for d in ['x', 'y', 'z']], name, *args, **kwd_args)

dts = ([manager.DataType('temperature', float, units='deg C', thresholds=(-20, 80))] +
[manager.DataType('bmp_alt', float, units='m', thresholds=(-100, 80000))] +
[manager.DataType('gps_alt', float, units='m', thresholds=(-100, 80000))] +
[manager.DataType('gps_lat', float, units='deg', thresholds=(-91, 80))] +
[manager.DataType('gps_lon', float, units='deg', thresholds=(-20, 80))] +
[manager.DataType('gps_vel', float, units='xy m/s', thresholds=(-20, 80))] +
[manager.DataType('gps_dir', float, units='xy deg', thresholds=(-20, 80))] +
[manager.DataType('xy_from_lanch', float, units='deg C', thresholds=(-20, 80))] +
[manager.DataType('dir_from_launch', float, units='deg C', thresholds=(-20, 80))] +
vector_DataType('magnetometer', float, units='mu T', thresholds=(-100, 100)) +
vector_DataType('gyro', float, units='rad/s', thresholds=(-100, 100)) +
vector_DataType('euler_angle', float, units='degrees', thresholds=(0, 360)) +
vector_DataType('acceleration', float, units='m/sec^2', thresholds=(-50, 50)))
plots = [plot.Plot('time', ['bmp_alt', 'gps_alt'], "Altitude", width=2, show_x_label=False),
plot.Plot('time', 'gps_lat', width=1, show_x_label=False),
plot.Plot('time', 'gps_lon', width=1, show_x_label=False),
vector_Plot('time', 'gyro', width=4),
vector_Plot('time', 'euler_angle', width=4),
vector_Plot('time', 'acceleration', width=4)]
dispatcher = manager.Dispatcher(*dts)
manager = manager.DataManager(dispatcher)
root = Tk()
app = gui.Application(dispatcher, manager, plots, master=root,
serial_console_height=10,
default_baud=57600)

if __name__ == '__main__':
app.mainloop()
19 changes: 15 additions & 4 deletions drivers/flight_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@ def vector_Plot(x, y, name=None, *args, **kwd_args):
return plot.Plot(x, [d + "_" + y for d in ['x', 'y', 'z']], name, *args, **kwd_args)

dts = ([manager.DataType('temperature', float, units='deg C', thresholds=(-20, 80))] +
vector_DataType('magnetometer', float, thresholds=(-100, 100)) + # TODO: units
vector_DataType('gyro', float, thresholds=(-100, 100)) + # TODO: units
[manager.DataType('bmp_alt', float, units='m', thresholds=(-100, 80000))] +
krame505 marked this conversation as resolved.
Show resolved Hide resolved
[manager.DataType('gps_alt', float, units='m', thresholds=(-100, 80000))] +
[manager.DataType('gps_lat', float, units='deg', thresholds=(-91, 91))] +
[manager.DataType('gps_lon', float, units='deg', thresholds=(-181, 181))] +
[manager.DataType('gps_vel', float, units='xy m/s', thresholds=(-20, 100))] +
[manager.DataType('gps_dir', float, units='xy deg', thresholds=(-20, 365))] +
[manager.DataType('xy_from_lanch', float, units='xy m', thresholds=(-20, 100000))] +
[manager.DataType('dir_from_launch', float, units='xy deg', thresholds=(-20, 365))] +
[manager.DataType('sats', float, units='#', thresholds=(-10, 169))] +
vector_DataType('magnetometer', float, units='mu T', thresholds=(-100, 100)) +
vector_DataType('gyro', float, units='rad/s', thresholds=(-100, 100)) +
vector_DataType('euler_angle', float, units='degrees', thresholds=(0, 360)) +
vector_DataType('acceleration', float, units='m/sec^2', thresholds=(-50, 50)))
plots = [vector_Plot('time', 'magnetometer', width=4),
plots = [plot.Plot('time', ['bmp_alt', 'gps_alt'], "Altitude", width=2, show_x_label=False),
plot.Plot('time', 'gps_lat', width=1, show_x_label=False),
plot.Plot('time', 'gps_lon', width=1, show_x_label=False),
vector_Plot('time', 'gyro', width=4),
vector_Plot('time', 'euler_angle', width=4),
vector_Plot('time', 'acceleration', width=4)]
Expand All @@ -33,7 +44,7 @@ def vector_Plot(x, y, name=None, *args, **kwd_args):
root = Tk()
app = gui.Application(dispatcher, manager, plots, master=root,
serial_console_height=10,
default_baud=38400)
default_baud=57600)

if __name__ == '__main__':
app.mainloop()