def __init__(self, name, xpos, ypos, color, perimeter=[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]], radius=0.013): self.name = name self.xpos = xpos self.ypos = ypos self.xvel = 0.0 self.yvel = 0.0 self.color = color self.radius = radius # Perimeters must be specified clockwise (looking down). self.perimeter = [(p, (q[0] - p[0], q[1] - p[1])) \ for p,q in zip(perimeter[0:-1],perimeter[1:]) ] print self.perimeter CreateModel.__init__(self, self.xpos, self.ypos, 3.0, name=self.name, color=self.color, trails=False, nose=True, debug=False, radius=self.radius) self.sub = rospy.Subscriber(self.name + "/cmd_vel", Twist, self.twist)
def __init__(self, name, xpos, ypos, color, perimeter=[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]], radius=0.013): self.xvel = 0.0 self.yvel = 0.0 # Perimeters must be specified clockwise (looking down). self.perimeter = [(p, (q[0] - p[0], q[1] - p[1])) \ for p,q in zip(perimeter[0:-1],perimeter[1:]) ] # This records the number of communication hops between here and # the base station or primary robot. self.hops = 0 CreateModel.__init__(self, xpos, ypos, 3.0, name=name, color=color, trails=False, nose=True, debug=False, radius=radius) self.sub = rospy.Subscriber(self.name + "/cmd_vel", Twist, self.twist)
def __init__(self, name, xpos, xvel, color): self.name = name self.xpos = xpos self.xvel = xvel self.color = color CreateModel.__init__(self, self.xpos, 0.0, 0.0, name=self.name, color=self.color, trails=False, nose=False, debug=False) topic = (self.name + "/") if self.name else "" topic += "cmd_vel" self.sub = rospy.Subscriber(topic, Twist, self.setVel)
def __init__(self, name, xpos, ypos, color, perimeter = [[0.0,0.0],[1.0,0.0],[1.0,1.0],[0.0,1.0],[0.0,0.0]], radius = 0.013): self.xvel = 0.0 self.yvel = 0.0 # Perimeters must be specified clockwise (looking down). self.perimeter = [(p, (q[0] - p[0], q[1] - p[1])) \ for p,q in zip(perimeter[0:-1],perimeter[1:]) ] # This records the number of communication hops between here and # the base station or primary robot. self.hops = 0 CreateModel.__init__(self, xpos, ypos, 3.0, name=name, color=color, trails=False, nose=True, debug=False, radius = radius) self.sub = rospy.Subscriber(self.name + "/cmd_vel", Twist, self.twist)
def __init__(self, name, xpos, ypos, color, perimeter = [[0.0,0.0],[1.0,0.0],[1.0,1.0],[0.0,1.0],[0.0,0.0]], radius = 0.013): self.name = name self.xpos = xpos self.ypos = ypos self.xvel = 0.0 self.yvel = 0.0 self.color = color self.radius = radius # Perimeters must be specified clockwise (looking down). self.perimeter = [(p, (q[0] - p[0], q[1] - p[1])) \ for p,q in zip(perimeter[0:-1],perimeter[1:]) ] print self.perimeter CreateModel.__init__(self, self.xpos, self.ypos, 3.0, name=self.name, color=self.color, trails=False, nose=True, debug=False, radius = self.radius) self.sub = rospy.Subscriber(self.name + "/cmd_vel", Twist, self.twist)