Ejemplo n.º 1
0
 def __init__(self, stance, method, color='g'):
     if color is None:
         color = (0., 0.5, 0., 0.5)
     if type(color) is str:
         color = matplotlib_to_rgb(color) + [0.5]
     super(SupportPolygonDrawer, self).__init__()
     self.color = color
     self.contact_poses = {}
     self.handle = None
     self.method = method
     self.stance = stance
     self.z = z_polygon
     #
     self.update_contact_poses()
     self.update_polygon()
Ejemplo n.º 2
0
 def __init__(self, stance, scale=0.1, color=None):
     super(AccelConeDrawer, self).__init__()
     self.scale = scale  # done before calling parent constructor
     if color is None:
         color = (0., 0.5, 0., 0.5)
     if type(color) is str:
         color = matplotlib_to_rgb(color) + [0.5]
     self.color = color
     self.contact_poses = {}
     self.handle = None
     self.last_com = stance.com.p
     self.stance = stance
     #
     self.update_contact_poses()
     self.update_cone()
Ejemplo n.º 3
0
 def __init__(self, stance, height=0., color=None):
     self.stance = stance  # before calling parent constructor
     if color is None:
         color = (0., 0.5, 0., 0.5)
     if type(color) is str:
         color = matplotlib_to_rgb(color) + [0.5]
     super(SupportAreaDrawer, self).__init__()
     self.color = color
     self.contact_poses = {}
     self.handle = None
     self.height = height
     self.last_com = stance.com.p
     self.stance = stance
     #
     self.update_contact_poses()
     self.update_polygon()
 def __init__(self, stance, z=0., color=None, method='qhull'):
     if color is None:
         color = (0., 0.5, 0., 0.5)
     if type(color) is str:
         color = matplotlib_to_rgb(color) + [0.5]
     super(SupportPolyhedronDrawer, self).__init__()
     self.color = color
     self.contact_poses = {}
     self.handle = None
     self.max_iter = 50
     self.method = method
     self.nr_iter = 0
     self.polyhedron = None
     self.stance = stance
     self.z = z
     #
     self.update_contacts()
     self.create_polyhedron(self.stance.contacts)