Exemplo n.º 1
0
from pyrosim import PYROSIM
import matplotlib.pyplot as plt

sim = PYROSIM(playPaused=True , evalTime=100)
sim.Send_Cylinder( objectID=0, x=0 , y=0 , z=.6 , length=1.0 , radius=0.1 )
sim.Send_Cylinder( objectID=1 , x=0 , y=.5 , z=1.1 , r1=0 , r2=1, r3=0 , length=1.0 , radius=0.1 , r=1, g=0, b=0)

sim.Send_Joint( jointID = 0 , firstObjectID = 0 , secondObjectID = 1, x=0 , y=0 , z=1.1, n1 = -1 , n2 = 0 , n3 = 0, lo=-3.14159/2 , hi=3.14159/2 )

sim.Send_Touch_Sensor( sensorID = 0 , objectID = 0 )
sim.Send_Touch_Sensor( sensorID = 1 , objectID = 1 )

sim.Start()
sim.Wait_To_Finish()
sensorData = sim.Get_Sensor_Data(sensorID = 1)
print sensorData

#f = plt.figure()
#pn = f.add_subplot(111)
#plt.plot(sensorData)
#plt.show()
Exemplo n.º 2
0
from pyrosim import PYROSIM

sim = PYROSIM()

sim.Send_Cylinder()

sim.Start()
Exemplo n.º 3
0
from pyrosim import PYROSIM

ARM_LENGTH = 0.5

ARM_RADIUS = ARM_LENGTH / 10.0

sim = PYROSIM(playPaused=True, evalTime=1000)

sim.Send_Cylinder(ID=0,
                  x=0,
                  y=0,
                  z=ARM_LENGTH / 2.0 + ARM_RADIUS,
                  r1=0,
                  r2=0,
                  r3=1,
                  length=ARM_LENGTH,
                  radius=ARM_RADIUS)

sim.Send_Cylinder(ID=1,
                  x=0,
                  y=ARM_LENGTH / 2.0,
                  z=ARM_LENGTH + ARM_RADIUS,
                  r1=0,
                  r2=1,
                  r3=0,
                  length=ARM_LENGTH,
                  radius=ARM_RADIUS)

sim.Send_Joint(ID=0,
               firstObjectID=0,
               secondObjectID=1,
Exemplo n.º 4
0
from pyrosim import PYROSIM

sim = PYROSIM(playPaused = True , evalTime = 1000)

x = 0

y = 0

z = 0.1

for i in range(0,10):

	sim.Send_Cylinder(x=x, y=y, z=z, r1=0, r2=1, r3=0, length=1.0, radius=0.1)

	z = z + 2.0 * 0.1

sim.Start()
Exemplo n.º 5
0
from pyrosim import PYROSIM

WHEEL_RADIUS = 0.1

sim = PYROSIM(playPaused=False, evalTime=1000)

sim.Send_Cylinder(objectID=0,
                  x=-2 * WHEEL_RADIUS,
                  y=-2 * WHEEL_RADIUS,
                  z=WHEEL_RADIUS,
                  length=0,
                  radius=WHEEL_RADIUS)

sim.Send_Box(objectID=1,
             x=0,
             y=0,
             z=WHEEL_RADIUS,
             length=4 * WHEEL_RADIUS,
             width=4 * WHEEL_RADIUS,
             height=WHEEL_RADIUS)

sim.Send_Joint(jointID=0,
               firstObjectID=0,
               secondObjectID=1,
               x=-2 * WHEEL_RADIUS,
               y=-2 * WHEEL_RADIUS,
               z=WHEEL_RADIUS,
               n1=1,
               n2=0,
               n3=0,
               lo=-3.14159 / 4.0,
Exemplo n.º 6
0
from pyrosim import PYROSIM

sim = PYROSIM(playPaused=True, evalTime=1000)

sim.Send_Cylinder(x=0, y=0, z=0.5, r1=0, r2=1, r3=0)

sim.Start()
Exemplo n.º 7
0
from pyrosim import PYROSIM

sim = PYROSIM(playPaused = True , evalTime = 1000)

sim.Send_Cylinder(x=0, y=0, z=0.1, r1=0, r2=1, r3=0, length=1.0, radius=0.1)

sim.Start()
Exemplo n.º 8
0
ARM_RADIUS = ARM_LENGTH / 10.0

sim = PYROSIM(playPaused = False , evalTime = 250)

z = 0.5

x_1 = 0
y_1 = ARM_LENGTH/2.0
z_1 = z
x_2 = ARM_LENGTH*math.cos(math.pi/4.)/2.0
y_2 = ARM_LENGTH*math.sin(math.pi/4.)/2.0+ARM_LENGTH
print x_2, y_2
x_3 = -x_2
y_3 = y_2

sim.Send_Cylinder(ID = 0 , x=x_1, y=y_1, z=z, r1=0, r2=1, r3=0, length=ARM_LENGTH, radius=ARM_RADIUS)
sim.Send_Cylinder(ID = 1 , x=x_2, y=y_2, z=z, r1=1, r2=1, r3=0, length=ARM_LENGTH, radius=ARM_RADIUS)
sim.Send_Cylinder(ID = 2 , x=x_3, y=y_3, z=z, r1=-1,r2=1,r3=0, length=ARM_LENGTH,radius =ARM_RADIUS)

sim.Send_Joint(ID = 0, firstObjectID=0, x=0, y=0, z=z, n1=0, n2=0, n3=1, lo=-3.14159/4.0, hi=+3.14159/4.0)
sim.Send_Joint(ID = 1, firstObjectID=0, secondObjectID=1,x=0, y=1, z=z, n1=0, n2=0, n3=1, lo=-3.14159/4.0, hi=+3.14159/4.0)
sim.Send_Joint(ID = 2, firstObjectID=0, secondObjectID=2,x=0, y=1, z=z, n1=0, n2=0, n3=1, lo=-3.14159/4.0, hi=+3.14159/4.0)

sim.Send_Touch_Sensor(ID = 0 , objectIndex = 0)

sim.Send_Touch_Sensor(ID = 1 , objectIndex = 1)

sim.Send_Sensor_Neuron(ID=0, sensorID=0 )

sim.Send_Sensor_Neuron(ID=1, sensorID=1 )
Exemplo n.º 9
0
ARM_RADIUS = ARM_LENGTH / 10.0

for torque in [0.1, 0.5, 1.0]:
    for speed in [0.1, 1.0, 10.0]:
        sim = PYROSIM(playPaused=False,
                      evalTime=500,
                      dt=.05,
                      debug=False,
                      hpr=[121, 5, 0])

        sim.Send_Cylinder(objectID=0,
                          x=0,
                          y=0,
                          z=2.0 * ARM_LENGTH,
                          r1=0,
                          r2=0,
                          r3=1,
                          length=ARM_LENGTH,
                          radius=ARM_RADIUS)
        sim.Send_Box(objectID=2,
                     x=0,
                     y=0,
                     z=1.25 * ARM_LENGTH,
                     length=ARM_RADIUS * 7.,
                     width=ARM_RADIUS * 7.0,
                     height=ARM_RADIUS * 7.0)

        sim.Send_Joint(jointID=0,
                       firstObjectID=-1,
                       secondObjectID=0,
Exemplo n.º 10
0
from pyrosim import PYROSIM

sim = PYROSIM(playPaused=True, evalTime=1000)

sim.Send_Cylinder(r1=0, r2=1, r3=0)

sim.Start()