class Node: def __init__(self): self.driver = Drive() rospy.init_node("phoebe", anonymous=True) rospy.Subscriber("cmd_vel", Twist, self.didReceiveTwist) rospy.spin() def didReceiveTwist(self, twist): self.driver.steer(twist.twist.angular.y) self.driver.accelerate(twist.twist.linear.z)
def __init__(self): self.driver = Drive() rospy.init_node("phoebe", anonymous=True) rospy.Subscriber("cmd_vel", Twist, self.didReceiveTwist) rospy.spin()