3 from std_msgs.msg
import Bool
4 from dataspeed_ulc_msgs.msg
import UlcCmd
17 self.ulc_cmd.enable_pedals =
True 18 self.ulc_cmd.enable_steering =
False 19 self.ulc_cmd.shift_from_park =
False 22 rospy.Subscriber(
'/vehicle/dbw_enabled', Bool, self.
recv_enable)
23 self.
pub_ulc_cmd = rospy.Publisher(
'/vehicle/ulc_cmd', UlcCmd, queue_size=1)
26 self.
v1 = rospy.get_param(
'~v1', default=0.0)
27 self.
v2 = rospy.get_param(
'~v2', default=5.0)
28 self.
period = rospy.get_param(
'~period', default=10.0)
29 self.ulc_cmd.enable_shifting = rospy.get_param(
'~enable_shifting', default=
False)
30 self.ulc_cmd.linear_accel = rospy.get_param(
'~accel_limit', default=0.0)
31 self.ulc_cmd.linear_decel = rospy.get_param(
'~decel_limit', default=0.0)
38 if msg.data
and not self.enabled:
41 self.enabled = msg.data
def recv_enable(self, msg)
def timer_callback(self, event)