Exemplo n.º 1
0
    def __init__(self, width=100, length=100,
                 target_speed=0.1,
                 target_color=0,
                 target_radius=0.05,
                 target_start_distance=1,
                 target_id_dynamics='d_SE2_fwd_v',
                 target_stabilize_phi= -np.pi,
                 world_texture=random_checkerboard(0.5)):
        self.width = width
        self.target_stabilize_phi = target_stabilize_phi
        self.length = length
        self.target_dynamics = instance_dynamics(target_id_dynamics)
        self.target_speed = target_speed
        self.target_radius = target_radius
        self.target_start_distance = target_start_distance
        
        r = 1
        bounds = [[-width * r, +width * r],
                  [-length * r, +length * r],
                  [0, 5]]
        World.__init__(self, bounds)

        self.box = box(0, world_texture, width, length)
        self.target = Circle(id_object=1, tags=[],
                             texture=constant_texture(target_color),
                             center=[0, 0],
                             radius=target_radius,
                             solid=True)
Exemplo n.º 2
0
 def __init__(self, radius=1, texture_scale=0.1):
     
     texture = random_checkerboard(texture_scale)
     
     R = radius
     bounds = [[-R, +R], [-R, R], [0, 5]]
     World.__init__(self, bounds) 
     
     self.circle = Circle(id_object=0, tags=[],
                            texture=texture, center=[0, 0], radius=R)
Exemplo n.º 3
0
    def __init__(self, id_worlds):
        self.id_worlds = id_worlds
        self.worlds = [get_conftools_worlds().instance(id_world) 
                       for id_world in id_worlds] 

        wb = [w.bounds for w in self.worlds]

        bounds = [[np.min([b[0][0] for b in wb]),
                   np.max([b[0][1] for b in wb])],
                  [np.min([b[1][0] for b in wb]),
                   np.max([b[1][1] for b in wb])],
                  [np.min([b[2][0] for b in wb]),
                   np.max([b[2][1] for b in wb])]]
        bounds = np.array(bounds).tolist()
        World.__init__(self, bounds)
Exemplo n.º 4
0
    def __init__(self, id_worlds):
        self.id_worlds = id_worlds
        self.worlds = [
            get_conftools_worlds().instance(id_world) for id_world in id_worlds
        ]

        wb = [w.bounds for w in self.worlds]

        bounds = [
            [np.min([b[0][0] for b in wb]),
             np.max([b[0][1] for b in wb])],
            [np.min([b[1][0] for b in wb]),
             np.max([b[1][1] for b in wb])],
            [np.min([b[2][0] for b in wb]),
             np.max([b[2][1] for b in wb])]
        ]
        bounds = np.array(bounds).tolist()
        World.__init__(self, bounds)
Exemplo n.º 5
0
 def __init__(self, width=2, length=100,
              texture_L=None, texture_R=None):
     
     if texture_L is None:
         texture_L = random_checkerboard(0.5)
     if texture_R is None:
         texture_R = random_checkerboard(0.5)
         
     L = width / 2.0
     
     bounds = [[-L, +L], [0, length], [0, 5]]
     World.__init__(self, bounds) 
     
     points_L = [ [-L, 0], [-L, length]]
     points_R = [ [+L, 0], [+L, length]]
     self.wall_L = PolyLine(id_object=0, tags=[],
                            texture=texture_L, points=points_L)
     self.wall_R = PolyLine(id_object=1, tags=[],
                            texture=texture_R, points=points_R)