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)
 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)
 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)
Example #4
0
 def __init__(self,
              world_radius=100,
              target_id_dynamics='d_SE2_fwd_v',
              target_start_distance=1,
              target_color=0,
              target_radius=0.05,
              world_texture_scale=0.5):
     
     self.world = ChasingWorld(width=world_radius,
              target_color=target_color,
              target_radius=target_radius,
              target_start_distance=target_start_distance,
              target_id_dynamics=target_id_dynamics,
              target_stabilize_phi= -np.pi,
              world_texture=random_checkerboard(world_texture_scale))