-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlive_tuning.py
More file actions
38 lines (31 loc) · 1.15 KB
/
live_tuning.py
File metadata and controls
38 lines (31 loc) · 1.15 KB
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
import usefulFunctions as us
import evaluatePoints as ev
import stereoTracking as st
import robotFunctions as rb
import calibrateCameras as cb
import zaberCommands as zc
import os
import time
import numpy as np
import test_runTests as rt
import Tkinter as tk
if __name__ == '__main__':
settingsPath = "settingsLogi.json"
if not os.path.isfile(settingsPath):
print settingsPath + " could not be located"
userSettings = us.readJson(settingsPath)
Lcam_int = userSettings["Lcam"]
Rcam_int = userSettings["Rcam"]
calConstants = cb.loadCalibration(userSettings["calPath"])
if calConstants is None:
print "Calibration settings at " + userSettings["calPath"] + " could not be found."
# Begin tracking end effector. At this point, all stages should be at 'home' position
sqSize = userSettings["chessboardSquareSize"]
track = st.StereoTracker(calConstants, sqSize) # initialize stereo tracker
track.initializeCameras(Lcam_int, Rcam_int, Lcam_exposure=-5, Rcam_exposure=-5, fps=30)
print ""
print "Align cameras so full robotic range of motion is in both views and press Q+ENTER"
track.showMaskTune('pink')
print ""
print "Starting tracking..."
track.close()