Skip to content
Snippets Groups Projects
Commit 8d19f281 authored by jmchoi1225's avatar jmchoi1225
Browse files

pitch, roll : mean of all -> last data

parent b99668d3
Branches
No related tags found
No related merge requests found
......@@ -49,8 +49,8 @@ if(fpDistance.fileCount()>0):
if fpAngle.fileCount()>0:
angleDatas = [angle for angle in fpAngle.read(-1, False) if angle[1]=='4']
_thread.start_new_thread(fpAngle.removeAllFile,())
pitch = statistics.mean([float(a) for a in angleDatas[4]])* 2 / 32767 * math.pi
roll = statistics.mean([float(a) for a in angleDatas[5]])* 2 / 32767 * math.pi
pitch = float(angleDatas[-1][4])* 2 / 32767 * math.pi
roll = float(angleDatas[-1][5])* 2 / 32767 * math.pi
radian = math.acos(math.sqrt(1 / (1 + math.tan(pitch) * math.tan(pitch) + math.tan(roll) * math.tan(roll))))
height = distance*math.cos(radian) + distance2*math.sin(radian)
width = distance2*math.cos(radian)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment