def __init__(self): self.node_name = rospy.get_name() rospy.loginfo("[%s] Initializing " % (self.node_name)) self.car_like_mode = self.setupParam("~car_like_mode", True) # Setup publishers self.dagu = DAGU_Differential_Drive(car_like_mode=self.car_like_mode) self.dagu.setSpeed(0.0) self.dagu.setSteerAngle(0.0) self.control_msg = None # self.control_msg = CarControl() # self.control_msg.speed = 0.0 # self.control_msg.steering = 0.0 # Setup subscribers self.sub_topic = rospy.Subscriber("~car_control", CarControl, self.cbControl) # Create a timer that calls the cbTimer function every 1.0 second self.timer = rospy.Timer(rospy.Duration.from_sec(0.02), self.cbTimer) self.last_cmd = None