Example #1
0
if (len(sys.argv) != 3):
    print sys.argv[0] + ' (front|back) file.PRT'
    sys.exit()
side = sys.argv[1]
if (side == 'front'):
    near = 'Stereo'
    far = 'Axial'
elif (side == 'back'):
    near = 'Axial'
    far = 'Stereo'
else:
    print 'Invalid side'
    sys.exit()

stepdict = ogp_util.getsteps(sys.argv[2])

fixture_basis = ogp_util.l123_basis()
meas_basis = ogp_util.get_measbasis(stepdict, fixture_basis)

points = ogp_util.get_points(stepdict, near, 7, 4)

#print points
points = ogp_util.transform_pts(meas_basis, fixture_basis, points)
#print points

[fiducials_nominal, p0] = ogp_util.l123_fiducials(side)

sol = scipy.optimize.leastsq(ogp_util.sensor_fitfunc,
                             p0,
                             args=(points, fiducials_nominal))[0]
Example #2
0
			np.array([0.0, 0.0, 1.0]))
	is_top = -1
else:
	print 'Invalid side'
	sys.exit()

l1s = ogp_util.make_sensor_basis(ogp_util.get_l123_sensor(sys.argv[5],'front')) #pin basis in sensor frame
#print l1s
l1a = ogp_util.make_sensor_basis(ogp_util.get_l123_sensor(sys.argv[6],'back'))
#print l1a
l2s = ogp_util.make_sensor_basis(ogp_util.get_l123_sensor(sys.argv[7],'front'))
l2a = ogp_util.make_sensor_basis(ogp_util.get_l123_sensor(sys.argv[8],'back'))
l3s = ogp_util.make_sensor_basis(ogp_util.get_l123_sensor(sys.argv[9],'front'))
l3a = ogp_util.make_sensor_basis(ogp_util.get_l123_sensor(sys.argv[10],'back'))

noballsdict = ogp_util.getsteps(sys.argv[2])
ballsdict = ogp_util.getsteps(sys.argv[3])
modulesdict = ogp_util.getsteps(sys.argv[4])




holeupst = np.empty([3])
holedownst = np.empty([3])
slotupst = np.empty([3])
slotdownst = np.empty([3])
holeupst[0]=ballsdict['L1 hole ball']['X Location'][1]
holeupst[1]=ballsdict['L1 hole ball']['Y Location'][1]
holeupst[2]=ballsdict['L1 hole ball']['Z Location'][1]
holedownst[0]=ballsdict['L3 hole ball']['X Location'][1]
holedownst[1]=ballsdict['L3 hole ball']['Y Location'][1]
Example #3
0
#print l4se
#print l4sp
#print l4ae
#print l4ap
#print l5se
#print l5sp
#print l5ae
#print l5ap
#print l6se
#print l6sp
#print l6ae
#print l6ap


noballsdict = ogp_util.getsteps(sys.argv[2])
ballsdict = ogp_util.getsteps(sys.argv[3])
modulesdict = ogp_util.getsteps(sys.argv[4])

holeupst = np.empty([3])
holedownst = np.empty([3])
slotupst = np.empty([3])
slotdownst = np.empty([3])
holeupst[0]=ballsdict['L4 hole ball']['X Location'][1]
holeupst[1]=ballsdict['L4 hole ball']['Y Location'][1]
holeupst[2]=ballsdict['L4 hole ball']['Z Location'][1]
holedownst[0]=ballsdict['L6 hole ball']['X Location'][1]
holedownst[1]=ballsdict['L6 hole ball']['Y Location'][1]
holedownst[2]=ballsdict['L6 hole ball']['Z Location'][1]
slotupst[0]=ballsdict['L4 slot ball']['X Location'][1]
slotupst[1]=ballsdict['L4 slot ball']['Y Location'][1]
Example #4
0
if (len(sys.argv)!=3):
	print sys.argv[0]+' (front|back) file.PRT'
	sys.exit()
side = sys.argv[1]
if (side=='front'):
	near = 'Stereo'
	far = 'Axial'
elif (side=='back'):
	near = 'Axial'
	far = 'Stereo'
else:
	print 'Invalid side'
	sys.exit()

stepdict = ogp_util.getsteps(sys.argv[2])

fixture_basis = ogp_util.l456_basis()
meas_basis = ogp_util.get_measbasis(stepdict, fixture_basis)

def check_alignment(moduleend):
	sensorname = near+' '+moduleend
	points = np.empty([3,11])
	points = ogp_util.get_points(stepdict, sensorname, 4, 7)

	#print points
	for i in range(0,11):
		points[:,i] = ogp_util.transform_pt(meas_basis,fixture_basis,points[:,i])

	#print points
Example #5
0
#!/usr/bin/env python
import sys, math
import numpy as np
import scipy.optimize
import ogp_util

np.set_printoptions(precision=3)

if (len(sys.argv) != 5):
    print sys.argv[0] + ' t13.PRT b13.PRT t46.PRT b46.PRT'
    sys.exit()

t13dict = ogp_util.getsteps(sys.argv[1])
b13dict = ogp_util.getsteps(sys.argv[2])
t46dict = ogp_util.getsteps(sys.argv[3])
b46dict = ogp_util.getsteps(sys.argv[4])


def ball_basis(dict, upst, downst):

    holeupst = np.empty([3])
    holedownst = np.empty([3])
    slotupst = np.empty([3])
    slotdownst = np.empty([3])
    holeupst[0] = dict[upst + ' hole ball reference']['X Location'][1]
    holeupst[1] = dict[upst + ' hole ball reference']['Y Location'][1]
    holeupst[2] = dict[upst + ' hole ball reference']['Z Location'][1]
    holedownst[0] = dict[downst + ' hole ball reference']['X Location'][1]
    holedownst[1] = dict[downst + ' hole ball reference']['Y Location'][1]
    holedownst[2] = dict[downst + ' hole ball reference']['Z Location'][1]
    slotupst[0] = dict[upst + ' slot ball reference']['X Location'][1]
Example #6
0
#!/usr/bin/env python
import sys,math
import numpy as np
import scipy.optimize
import ogp_util

np.set_printoptions(precision=3)

if (len(sys.argv)!=5):
	print sys.argv[0]+' t13.PRT b13.PRT t46.PRT b46.PRT'
	sys.exit()

t13dict = ogp_util.getsteps(sys.argv[1])
b13dict = ogp_util.getsteps(sys.argv[2])
t46dict = ogp_util.getsteps(sys.argv[3])
b46dict = ogp_util.getsteps(sys.argv[4])

def ball_basis(dict, upst, downst):

	holeupst = np.empty([3])
	holedownst = np.empty([3])
	slotupst = np.empty([3])
	slotdownst = np.empty([3])
	holeupst[0]=dict[upst+' hole ball reference']['X Location'][1]
	holeupst[1]=dict[upst+' hole ball reference']['Y Location'][1]
	holeupst[2]=dict[upst+' hole ball reference']['Z Location'][1]
	holedownst[0]=dict[downst+' hole ball reference']['X Location'][1]
	holedownst[1]=dict[downst+' hole ball reference']['Y Location'][1]
	holedownst[2]=dict[downst+' hole ball reference']['Z Location'][1]
	slotupst[0]=dict[upst+' slot ball reference']['X Location'][1]
	slotupst[1]=dict[upst+' slot ball reference']['Y Location'][1]