else: pc = -99 atr = 0 if p == 2 else 1 else: pc = GetFloat("Prism constant [mm] (-99 for none) ", pc * 1000) / 1000.0 if pc > -99: ts.SetPc(pc) #pc = -99 atr = 0 if pc == 0.00344 else 1 print(ts.GetPc()) ts.SetATR(atr) raw_input("Target on prism and press enter") if atr: res = ts.MoveRel(Angle(0), Angle(0), atr) if 'errorCode' in res or ts.measureIface.state != ts.measureIface.IF_OK: print("Cannot target on prism") ts.measureIface.state = ts.measureIface.IF_OK continue res = ts.Measure() obs = ts.GetMeasure() obs['id'] = t_id geo_wrt.WriteData(obs) coo = ts.Coords() coo['id'] = t_id if pc > -99: coo['pc'] = pc elif 'pc' in coo: del coo['pc'] coo_wrt.WriteData(coo)
fn = sys.argv[5] # write out measurements wrt = FileWriter(angle='DEG', dist='.3f', fname=fn) if wrt.GetState() != wrt.WR_OK: sys.exit(-1) # open error ts = TotalStation(stationtype, mu, iface, wrt) ts.SetATR(0) # turn ATR off ts.SetEDMMode('RLSTANDARD') # reflectorless distance measurement ts.SetRedLaser(1) # turn red laser on w = raw_input("Target on lower left corner and press Enter") w1 = ts.GetAngles() w = raw_input("Target on upper right corner and press Enter") w2 = ts.GetAngles() dh = (w2['hz'].GetAngle() - w1['hz'].GetAngle()) / dh_nr dv = (w2['v'].GetAngle() - w1['v'].GetAngle()) / dv_nr # measurement loops for i in range(dh_nr + 1): # horizontal loop measdir = i % 2 # check modulo hz = Angle(w1['hz'].GetAngle() + i * dh, 'RAD') for j in range(dv_nr + 1): # vertical loop if measdir == 0: # move downward at odd steps to right ts.Move(hz, Angle(w1['v'].GetAngle() + j * dv, 'RAD')) else: # move upward at event steps to right ts.Move(hz, Angle(w2['v'].GetAngle() - j * dv, 'RAD')) ts.Measure() ts.GetMeasure()
mode='a', sep=';') else: wrt = EchoWriter() ts = TotalStation("Leica", mu, iface) slopeDist = 0 if edm not in mu.edmModes: edm = 'FAST' ts.SetEDMMode(edm) # initialize instrument and variables if mode > 0: ts.SetLock(0) ts.SetATR(1) ts.MoveRel(Angle(0), Angle(0), 1) ts.Measure() measurement = ts.GetMeasure() if 'distance' in measurement: slopeDist = measurement['distance'] if mode in (3, 4, 5): ts.SetLock(1) ts.LockIn() if mode == 5: last_hz = measurement['hz'] # direction of last measured point last_v = measurement['v'] prev_hz = measurement['hz'] # direction of last measured point prev_v = measurement['v'] moving = True limit = Angle('0-03-00', 'DMS') # minimal angle change to measure
if len(sys.argv) > 5: tol = float(sys.argv[5]) maxiter = 10 # number of iterations to find point on horizontal plan if len(sys.argv) > 6: maxiter = int(sys.argv[6]) iface = SerialIface("rs-232", port) wrt = CsvWriter( angle='DMS', dist='.3f', filt=['id', 'hz', 'v', 'distance', 'east', 'north', 'elev'], fname='stdout', mode='a', sep=';') ts = TotalStation(stationtype, mu, iface) ts.SetEDMMode('RLSTANDARD') # reflectorless distance measurement ts.Measure() # initial measurement for startpoint startp = ts.GetMeasure() if ts.measureIface.state != ts.measureIface.IF_OK or 'errorCode' in startp: print 'FATAL Cannot measure startpoint' exit(1) act = Angle(0) # actual angle from startpoint # height of startpoint above the horizontal axis height0 = math.cos(startp['v'].GetAngle()) * startp['distance'] w = True try: ts.SetRedLaser(1) except: pass while act.GetAngle() < maxa: # go around the whole circle ts.Measure() # measure distance0
sep=';') ts = TotalStation(stationtype, mu, iface) if isinstance(mu, Trimble5500): print("Set Trimble 550x to direct reflex (MNU 722)") raw_input() else: ts.SetATR(0) # ATR mode off ts.SetLock(0) # Lock mode off ts.SetEDMMode("RLSTANDARD") # Reflectorless distance measurement ts.SetRedLaser(1) # Direction of the points to defining the plane points = [] for i in range(numberOfPoints): raw_input("Target on %d point and press enter" % (i + 1)) ts.Measure() obs = ts.GetMeasure() if ts.measureIface.state != ts.measureIface.IF_OK or \ 'errorCode' in obs: print('Start again!') exit(1) # Calculation of the directed coordinates according to the instrument's origin obs['east'] = obs['distance'] * math.sin(obs['v'].GetAngle()) * \ math.sin(obs['hz'].GetAngle()) obs['north'] = obs['distance'] * math.sin(obs['v'].GetAngle()) * \ math.cos(obs['hz'].GetAngle()) obs['elev'] = obs['distance'] * math.cos(obs['v'].GetAngle()) wrt.WriteData(obs) points.append( obs) # Appending the observations to the list of measured points #print(points[i])