コード例 #1
0
def shapeGen():
	x, y = yield
	(x,y) = yield vibes.drawArrow([x-1, y-1], [x+1, y+1], 0.6, 'k[k]')
	(x,y) = yield vibes.drawAUV(x,y,45,2, 'k[y]')
	(x,y) = yield vibes.drawBox(x-1,x+1,y-2,y+2, "[b]")
	(x,y) = yield vibes.drawBoxesUnion([[x-1,x,y-2,y], [x-0.5,x+1,y-0.5,y+2]], "[r]")
	(x,y) = yield vibes.drawCircle(x,y,1, "g[m]")
	(x,y) = yield vibes.drawEllipse(x,y,2,1,45, color="r[darkCyan]")
	(x,y) = yield vibes.drawLine([[x-0.5, y-1], [x+1, y+0.5]], "k")
	(x,y) = yield vibes.drawPie( (x-2, y-2), (1,2.5), [20,70] , "y[cyan]")
	(x,y) = yield vibes.drawPolygon([[x-1,y-1], [x, y+1], [ x+1, y-1]], "k[orange]")
	(x,y) = yield vibes.drawRing(x,y, 1,2, '[red]')
	# (x,y) = yield vibes.drawPie( (x, y), (1,2), [0,360] , "y[cyan]")
	(x,y) = yield vibes.drawVehicle( x, y, 20, 1, "[darkBlue]")
	(x,y) = yield vibes.drawPoint( x,y, 1, "[k]")
	(x,y) = yield vibes.drawText( x,y, "Text", 1)
コード例 #2
0
ファイル: example_allfigures.py プロジェクト: ngnepist/VIBES
def shapeGen():
    x, y = yield
    (x, y) = yield vibes.drawArrow([x - 1, y - 1], [x + 1, y + 1], 0.6, 'k[k]')
    (x, y) = yield vibes.drawAUV(x, y, 45, 2, 'k[y]')
    (x, y) = yield vibes.drawBox(x - 1, x + 1, y - 2, y + 2, "[b]")
    (x, y) = yield vibes.drawBoxesUnion(
        [[x - 1, x, y - 2, y], [x - 0.5, x + 1, y - 0.5, y + 2]], "[r]")
    (x, y) = yield vibes.drawCircle(x, y, 1, "g[m]")
    (x, y) = yield vibes.drawEllipse(x, y, 2, 1, 45, color="r[darkCyan]")
    (x, y) = yield vibes.drawLine([[x - 0.5, y - 1], [x + 1, y + 0.5]], "k")
    (x, y) = yield vibes.drawPie((x - 2, y - 2), (1, 2.5), [20, 70], "y[cyan]")
    (x,
     y) = yield vibes.drawPolygon([[x - 1, y - 1], [x, y + 1], [x + 1, y - 1]],
                                  "k[orange]")
    (x, y) = yield vibes.drawRing(x, y, 1, 2, '[red]')
    # (x,y) = yield vibes.drawPie( (x, y), (1,2), [0,360] , "y[cyan]")
    (x, y) = yield vibes.drawVehicle(x, y, 20, 1, "[darkBlue]")
    (x, y) = yield vibes.drawPoint(x, y, 1, "[k]")
    (x, y) = yield vibes.drawText(x, y, "Text", 1)
コード例 #3
0
            m[r][1] = Interval(position[i][r][2]).inflate(PositionIncertitude) #y
        t = m[i][0][0]
        
        #SIVIA test for Robots secure area whith incertitude
        pdcRobots = IncertitudeRobots(m,r**2)
    
        # SIVIA test for Trail
        sizeKernelErosion = enemySpeed*(t-t_old)/(1000*echellePixel)
        print(sizeKernelErosion)
        imgTrail = computeTrail(imgOut, enemySpeed)
        imgIntegralTrail = cv2.integral(imgTrail)
        pdcTrail = ImageToBoxes(imgIntegralTrail,i0,j0,echellePixel)
          
        vibes.clearFigure('Robotique')
        boatBoxesNP = SIVIA(X0, pdcGascogne, pdcTrail, pdcRobots, epsilon)
          
        #Draw of the robots:
        for m_ in m:
            vibes.drawCircle(m_[0].mid(), m_[1].mid(), 0.2, '[k]')
        vibes.drawArrow([-15, -15], [-15, -10], 1, 'w[w]')
        vibes.drawArrow([-15, -15], [-10, -15], 1, 'w[w]')
    
          
        #Creation of the output image:
        imgT=np.zeros((j_max, i_max),dtype="uint8")
        imgOut=cv2.fillPoly(imgT,np.array( boatBoxesNP),(1,1,1))
    
        t_old = t
        

    vibes.endDrawing()
コード例 #4
0
ファイル: example.py プロジェクト: ThomasLeMezo/VIBES
# vibes.clearGroup("Pie", figure="test")

vibes.drawPie([0,0], [1,2], [160, 220]) #, 'g[y]')


# exit()
vibes.newFigure("test2")
vibes.setFigureProperties({'x':0, 'y':0, 'width':600, 'height':600})

# vibes.axisLimits(10,20,10,20)
vibes.axisLabels("titi", "toto")
# vibes.drawBox(-1,0,-4,-6,color='[r]', figure='test2')



# vibes.selectFigure("test")
# vibes.clearFigure()
# vibes.selectFigure("test2")
# vibes.saveImage('./test.svg', "test")
# vibes.closeFigure("test2")

vibes.drawBoxDiff([11, 13, 11, 24], [12,12.5, 11, 13], 'b[r]')

vibes.drawArrow([9, 9], [9, 10], 0.3, '[r]')
vibes.drawArrow([9, 9], [10, 9], 0.3, '[r]')

vibes.drawPolygon([[1,1], [1,4], [5,2], [5, 1]])
vibes.setFigureProperties({'viewbox':'equal'})

vibes.endDrawing()
コード例 #5
0
vibes.drawPie([5, 2], [1, 2], [160, 220])  #, 'g[y]')

# vibes.clearGroup("Pie", figure="test")

vibes.drawPie([0, 0], [1, 2], [160, 220])  #, 'g[y]')

# exit()
vibes.newFigure("test2")
vibes.setFigureProperties({'x': 0, 'y': 0, 'width': 600, 'height': 600})

# vibes.axisLimits(10,20,10,20)
vibes.axisLabels("titi", "toto")
# vibes.drawBox(-1,0,-4,-6,color='[r]', figure='test2')

# vibes.selectFigure("test")
# vibes.clearFigure()
# vibes.selectFigure("test2")
# vibes.saveImage('./test.svg', "test")
# vibes.closeFigure("test2")

vibes.drawBoxDiff([11, 13, 11, 24], [12, 12.5, 11, 13], 'b[r]')

vibes.drawArrow([9, 9], [9, 10], 0.3, '[r]')
vibes.drawArrow([9, 9], [10, 9], 0.3, '[r]')

vibes.drawPolygon([[1, 1], [1, 4], [5, 2], [5, 1]])
vibes.setFigureProperties({'viewbox': 'equal'})

vibes.endDrawing()
コード例 #6
0
from vibes import vibes
import time
from SaveLoadData import *


if __name__ == '__main__':
	A=[1,1]
	B=[0,-1]
	C=[-1,0]

	vibes.beginDrawing()
	vibes.newFigure('TestCase1')
	vibes.setFigureProperties({'x': 0, 'y': 0,'width': 500, 'height': 500})
	vibes.axisLimits(-25, 25, -25, 25)
	t,dt,Field,inc,dif,x,y,xmp,ymp,xm,ym = loadData("rot1.pckl")
	t,dt,Field,inc,dif,x2,y2,xmp,ymp,xm,ym = loadData("rot2.pckl")
	time.sleep(15)
	for i in range(len(t)):

		vibes.drawCircle(x[i], y[i], 1, 'black[green]')
		vibes.drawCircle(x2[i], y2[i], 1, 'black[red]')
		vibes.drawCircle(xm, ym, 0.4, 'black[blue]')
		vibes.drawArrow([20, 15], [15, 15], 1, 'black[black]')
		vibes.drawArrow([20, 10], [15, 10], 1, 'black[black]')
		vibes.drawArrow([20, 5], [15, 5], 1, 'black[black]')
		vibes.drawArrow([20, 0], [15, 0], 1, 'black[black]')
		vibes.drawArrow([20, -5], [15, -5], 1, 'black[black]')
		time.sleep(0.001)
		vibes.clearFigure()
	vibes.endDrawing()
コード例 #7
0
vibes.newFigure("test2")
vibes.setFigureProperties({'x':0, 'y':0, 'width':600, 'height':600})

# vibes.axisLimits(10,20,10,20)
vibes.axisLabels("titi", "toto")

vibes.showAxis(False)
# vibes.drawBox(-1,0,-4,-6,color='[r]', figure='test2')



# vibes.selectFigure("test")
# vibes.clearFigure()
# vibes.selectFigure("test2")
# vibes.saveImage('./test.svg', "test")
# vibes.closeFigure("test2")

vibes.drawBoxDiff([11, 13, 11, 24], [12,12.5, 11, 13], 'b[r]')

vibes.drawArrow([9, 9], [9, 10], 0.3, '[r]')
vibes.drawArrow([9, 9], [10, 9], 0.3, '[r]')

vibes.drawPolygon([[1,1], [1,4], [5,2], [5, 1]])
vibes.setFigureProperties({'viewbox':'equal'})

vibes.newFigure("raster")
vibes.drawArrow((0,0), (1,1), 0.1)


vibes.endDrawing()