Commit dcf2a422 authored by Philipp Auersperg's avatar Philipp Auersperg
Browse files

calibration ann eingegeben werden

parent db96d5a7
Showing with 22 additions and 11 deletions
+22 -11
No preview for this file type
......@@ -43,7 +43,6 @@ try:
accel_info:accel_info
gps_pos:gps_pos
btn_lifeview:btn_lifeview
# camera:camera
BoxLayout:
orientation:'vertical'
size_hint:.9,1
......@@ -64,14 +63,6 @@ try:
BoxLayout:
id:camera_space
size_hint:1,1
# Camera:
# id: camera
# # resolution: (640, 480)
# # resolution:(1280,960)
# resolution:(3264,1836)
#
# play: False
# size_hint:1,1
BoxLayout:
size_hint:1,None
ToggleButton:
......@@ -161,6 +152,7 @@ class CameraClick(BoxLayout):
print 'cam added:', self.camera.resolution
else:
print 'warning: no cam'
@property
def camera_active(self):
cam=self.camera
......
......@@ -161,10 +161,11 @@ Builder.load_string("""
<CamWindow>:
orientation:'vertical'
cam:cam
CameraClick:
id:cam
size_hint:1,.9
resolution:(1280,960)
# resolution:(1280,960)
BoxLayout:
size_hint:1,.1
......@@ -175,6 +176,10 @@ Builder.load_string("""
Button:
text:'stop'
on_release:root.on_stop()
TextInput:
id:fov
text:'1185'
""")
class CamWindow(BoxLayout):
......@@ -207,13 +212,27 @@ class CamWindow(BoxLayout):
def on_accel(self, *a):
self.draw_cube()
@property
def fov(self):
return float(self.ids.fov.text)
@property
def fov_corrected(self):
"""fov corrected if camera window size != camera resolution"""
print self.cam.camera.resolution, self.painter.widget.size
res=float(self.painter.widget.width)/self.cam.camera.resolution[0]*self.fov
print 'res:', res
return res
def draw_cube(self):
try:
distance=float(self.cam.distance.text)
except ValueError:
distance=7
self.painter.draw_cube(self.accel, fx=1185, sl=1, distance=distance, front_at_center=True)
self.fov_corrected
self.painter.draw_cube(self.accel, fx=self.fov_corrected, sl=1, distance=distance, front_at_center=True)
def on_start(self):
print self.accel
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment