From 193362a899aacd620ba6e3fb218e1ad16cf18eb4 Mon Sep 17 00:00:00 2001 From: Thomas Balch Date: Thu, 11 Nov 2021 10:45:06 -0500 Subject: [PATCH] Allow params to take on namespaces as prefixes (#1) --- .../src/throttle_interpolator.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ackermann_cmd_mux/src/throttle_interpolator.py b/ackermann_cmd_mux/src/throttle_interpolator.py index 0548801..1714931 100755 --- a/ackermann_cmd_mux/src/throttle_interpolator.py +++ b/ackermann_cmd_mux/src/throttle_interpolator.py @@ -11,29 +11,29 @@ class InterpolateThrottle: def __init__(self): # Allow our topics to be dynamic. - self.rpm_input_topic = rospy.get_param('~rpm_input_topic', '/vesc/commands/motor/unsmoothed_speed') - self.rpm_output_topic = rospy.get_param('~rpm_output_topic', '/vesc/commands/motor/speed') + self.rpm_input_topic = rospy.get_param('~rpm_input_topic', 'commands/motor/unsmoothed_speed') + self.rpm_output_topic = rospy.get_param('~rpm_output_topic', 'commands/motor/speed') - self.servo_input_topic = rospy.get_param('~servo_input_topic', '/vesc/commands/servo/unsmoothed_position') - self.servo_output_topic = rospy.get_param('~servo_output_topic', '/vesc/commands/servo/position') + self.servo_input_topic = rospy.get_param('~servo_input_topic', 'commands/servo/unsmoothed_position') + self.servo_output_topic = rospy.get_param('~servo_output_topic', 'commands/servo/position') - self.max_acceleration = rospy.get_param('/vesc/max_acceleration') - self.max_rpm = rospy.get_param('/vesc/vesc_driver/speed_max') - self.min_rpm = rospy.get_param('/vesc/vesc_driver/speed_min') - self.throttle_smoother_rate = rospy.get_param('/vesc/throttle_smoother_rate') - self.speed_to_erpm_gain = rospy.get_param('/vesc/speed_to_erpm_gain') + self.max_acceleration = rospy.get_param('max_acceleration') + self.max_rpm = rospy.get_param('vesc_driver/speed_max') + self.min_rpm = rospy.get_param('vesc_driver/speed_min') + self.throttle_smoother_rate = rospy.get_param('throttle_smoother_rate') + self.speed_to_erpm_gain = rospy.get_param('speed_to_erpm_gain') - self.max_servo_speed = rospy.get_param('/vesc/max_servo_speed') - self.steering_angle_to_servo_gain = rospy.get_param('/vesc/steering_angle_to_servo_gain') - self.servo_smoother_rate = rospy.get_param('/vesc/servo_smoother_rate') - self.max_servo = rospy.get_param('/vesc/vesc_driver/servo_max') - self.min_servo = rospy.get_param('/vesc/vesc_driver/servo_min') + self.max_servo_speed = rospy.get_param('max_servo_speed') + self.steering_angle_to_servo_gain = rospy.get_param('steering_angle_to_servo_gain') + self.servo_smoother_rate = rospy.get_param('servo_smoother_rate') + self.max_servo = rospy.get_param('vesc_driver/servo_max') + self.min_servo = rospy.get_param('vesc_driver/servo_min') # Variables self.last_rpm = 0 self.desired_rpm = self.last_rpm - self.last_servo = rospy.get_param('/vesc/steering_angle_to_servo_offset') + self.last_servo = rospy.get_param('steering_angle_to_servo_offset') self.desired_servo_position = self.last_servo # Create topic subscribers and publishers