def animate(i):
    analog_data=parser.readLidar()
    for index, item in enumerate(analog_data):
    	x,y = pol2cart(item,x_data[index])
    	if abs(x) > 2000:
    		x=0
    	if abs(y) > 2000:
    		y=0
    	ptArray[x+2000][y+2000]=200
    lines[0].set_data(x_data, analog_data)
    '''print np.sum(ptArray)'''
    return tuple(lines)
def animate(i):
    analog_data = parser.readLidar()
    for index, item in enumerate(analog_data):
        x, y = pol2cart(item, x_data[index])
        if abs(x) > 2000:
            x = 0
        if abs(y) > 2000:
            y = 0
        ptArray[x + 2000][y + 2000] = 200
    lines[0].set_data(x_data, analog_data)
    '''print np.sum(ptArray)'''
    return tuple(lines)
Beispiel #3
0
def animate(i):
    global start, last_x
    newnow = datetime.datetime.now();
    delta = newnow - start;
    start = newnow
    seconds = delta.total_seconds();
    #print("time since last animate = ", seconds)
    samples = round(seconds * 5000)
    x = np.linspace(last_x, last_x + seconds, samples)
    last_x += seconds;
    analog_data[0]=parser.readLidar()
    analog_data[1].extend(np.add(np.multiply(np.abs(np.sin(2 * np.pi * x * -1.0)), .3), 1.3))
    lines[0].set_data(x_data, analog_data[0])
    return tuple(lines)
Beispiel #4
0
def animate(i):
    global start, last_x
    newnow = datetime.datetime.now()
    delta = newnow - start
    start = newnow
    seconds = delta.total_seconds()
    #print("time since last animate = ", seconds)
    samples = round(seconds * 5000)
    x = np.linspace(last_x, last_x + seconds, samples)
    last_x += seconds
    analog_data[0] = parser.readLidar()
    analog_data[1].extend(
        np.add(np.multiply(np.abs(np.sin(2 * np.pi * x * -1.0)), .3), 1.3))
    lines[0].set_data(x_data, analog_data[0])
    return tuple(lines)
    '''print np.sum(ptArray)'''
    return tuple(lines)


# call the animator.  blit=True means only re-draw the parts that have changed.
'''anim = animation.FuncAnimation(fig, animate, init_func=init,
                               frames=1, interval=0, blit=True)'''
plt.xlabel('Time (s)')
plt.ylabel('Voltage (v)')
plt.ion()
plt.show()
for i in range(90):
    print i
    animate(i)
    plt.draw()
parser.lidarOff()

# save the animation as an mp4.  This requires ffmpeg or mencoder to be
# installed.  The extra_args ensure that the x264 codec is used, so that
# the video can be embedded in html5.  You may need to adjust this for
# your system: for more information, see
# http://matplotlib.sourceforge.net/api/animation_api.html
#anim.save('basic_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])

plt.grid(True)
print '4'
Houghlines = cv2.HoughLines(ptArray, 1, np.pi / 180, 10)
print '5'
print Houghlines
print '3'
for i in Houghlines:
Beispiel #6
0
import NewParser
if __name__ == "__main__":
    f = open('Tests/Test_Cases/SimpleSmaliTest/MainActivity.smali', 'r')
    smali_class = NewParser.parseSmaliFiles(f)
    print(smali_class.classname)
    for f in smali_class.fields:
        print(f.name, f.value)
    return tuple(lines)



# call the animator.  blit=True means only re-draw the parts that have changed.
'''anim = animation.FuncAnimation(fig, animate, init_func=init,
                               frames=1, interval=0, blit=True)'''
plt.xlabel('Time (s)')
plt.ylabel('Voltage (v)')
plt.ion()
plt.show()
for i in range(90):
	print i
	animate(i)
	plt.draw()
parser.lidarOff()

# save the animation as an mp4.  This requires ffmpeg or mencoder to be
# installed.  The extra_args ensure that the x264 codec is used, so that
# the video can be embedded in html5.  You may need to adjust this for
# your system: for more information, see
# http://matplotlib.sourceforge.net/api/animation_api.html
#anim.save('basic_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])

plt.grid(True)
print '4'
Houghlines = cv2.HoughLines(ptArray,1,np.pi/180,10)
print '5'
print Houghlines
print '3'
for i in Houghlines: