34 from std_msgs.msg
import Bool
35 from dbw_fca_msgs.msg
import ThrottleCmd
40 rospy.init_node(
'sine_test')
41 self.
pub = rospy.Publisher(
'/vehicle/throttle_cmd', ThrottleCmd, queue_size=1)
44 self.
high_peak = rospy.get_param(
'~high_peak', 0.92)
45 self.
low_peak = rospy.get_param(
'~low_peak', 0.08)
46 self.
period = rospy.get_param(
'~period', 4)
61 cmd = offset - amplitude * math.cos(2 * math.pi / self.
period * self.
t)
64 self.
pub.publish(ThrottleCmd(enable=
True, pedal_cmd_type=ThrottleCmd.CMD_PEDAL, pedal_cmd=cmd))
70 if __name__ ==
'__main__':
74 except rospy.ROSInterruptException: