def __init__(self, name, size=1, weight=2, fuel=100): update(self, name=name, pos=Struct(x=0.0, y=0.0, z=0.0), simulator=Morse(), type="robot", size = size, weight=weight, fuel=fuel) q = "pose_" q += self.name inst = getattr(self.simulator, self.name) pose = getattr(inst, q) pose.subscribe(self.setpos)
def __init__(self, name, type, pos, color, size): update(self, name=name, type = type, pos=pos, color=color, size = size,simulator=Morse())
def updated(d, *maps, **entries): """A "functional" version of update... """ dd = dict(**d) if isinstance(d, dict) else Struct(d) return update(dd, *maps, **entries)
def __init__(self, **entries): """Constructor. It needs the __type__, __typesystem__ and __value__ keys be present in **entries. """ # We want entries passed in to override those in self. update(self, **entries)