forked from International-Anglican-Church/visca-joystick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
30 lines (22 loc) · 911 Bytes
/
config.py
File metadata and controls
30 lines (22 loc) · 911 Bytes
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
from plotly import graph_objects as go
from visca_over_ip import CachingCamera as Camera
# from visca_over_ip import Camera
num_cams = 3
sensitivity_tables = {
'pan': {'joy': [0, 0.05, 0.3, 0.7, 0.9, 1], 'cam': [0, 0, 2, 8, 15, 20]},
'tilt': {'joy': [0, 0.07, 0.3, 0.65, 0.85, 1], 'cam': [0, 0, 3, 6, 14, 18]},
'zoom': {'joy': [0, 0.1, 1], 'cam': [0, 0, 7]},
}
camera_details = [
# {'host': '10.69.4.35', 'port': 52381}, # Default VISCA port for camera 2
# {'host': '10.69.4.39', 'port': 52381} # Default VISCA port for camera 3
]
if __name__ == '__main__':
from numpy import interp
fig = go.Figure()
for name in ['pan', 'tilt']:
x = [i * .001 for i in range(1000)]
y = interp(x, sensitivity_tables[name]['joy'], sensitivity_tables[name]['cam'])
y = [round(val) for val in y]
fig.add_trace(go.Scatter(x=x, y=y, name=name))
fig.show()