-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcd.py
66 lines (54 loc) · 1.07 KB
/
pcd.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import numpy as np
from math import atan
#fil1 = open('/home/a/Desktop/vsMovedq.txt.cpp')
fil1 = open('4.pcd')
w=1280
h=720
dd=57.295780490442965
def top(line):
#27.798019
return 0
toks = line.split();
x=float(toks[0])
y=float(toks[1])
z=float(toks[2])
print '1top',ind,ind/w,ind%w,line
print '2top',atan(y/x)*dd,atan(z/x)*dd,
def left(line):
return 0
toks = line.split();
x=float(toks[0])
y=float(toks[1])
z=float(toks[2])
print '1left',ind,ind/w,ind%w,line
print '2left',atan(y/x)*dd,atan(z/x)*dd,
def right(line):
#-41.84041
return 0
toks = line.split();
x=float(toks[0])
y=float(toks[1])
z=float(toks[2])
print '1right',ind,ind/w,ind%w,line
print '2right',atan(y/x)*dd,atan(z/x)*dd,
def down(line):
#-28.35467
toks = line.split();
x=float(toks[0])
y=float(toks[1])
z=float(toks[2])
print '1down',ind,ind/w,ind%w,line
print '2down',atan(y/x)*dd,atan(z/x)*dd,
ind=-1
for line in fil1 :
ind+=1
if line.find('nan')>=0:
continue
if ind<1280:
top(line)
if ind%1280==0:
left(line)
if ind%1280==1279:
right(line)
if ind>w*(h-1):
down(line)