1 import math, sys, time, os
7 area = [ (0.0, 0.0, -0.2), (3000.0, 2100.0, 0.2) ]
8 areasize = reduce(lambda x,y:tuple([abs(x[i])+abs(y[i]) for i in range(len(x))]) , area)
9 area_box = box(size=areasize, color=(0.0, 1.0, 0.0))
13 robot = box(pos = (0, 0, 150),
17 last_pos = robot.pos.x, robot.pos.y, robot.pos.z
21 def set_robot(x, y, a):
22 global robot, last_pos
23 robot.pos = (x - AREA_X/2, y - AREA_Y/2, 150)
24 robot.axis = (math.cos(a*math.pi/180) * 300,
25 math.sin(a*math.pi/180) * 300,
28 pos = robot.pos.x, robot.pos.y, robot.pos.z
30 robot_trail.append(pos)
32 robot_trail_l = len(robot_trail.pos)
33 if robot_trail_l> max_trail:
34 robot_trail.pos = robot_trail.pos[robot_trail_l - max_trail:]
38 os.mkfifo("/tmp/.robot")
42 f = open("/tmp/.robot")
47 x,y,a = map(lambda x:int(x), l[:-1].split(" "))
55 scene.center = x-10,y,z
57 scene.center = x+10,y,z
59 scene.center = x,y+10,z
61 scene.center = x,y-10,z