From 8963ce8c59573f14dee25394696a1d3f6cc7d765 Mon Sep 17 00:00:00 2001 From: "Wayne C. Gramlich" Date: Thu, 14 May 2015 08:54:55 -0700 Subject: [PATCH] Backed out changes that were accidently checked into hbrobotics repository. Explaination: I am president of Homebrew Roboics, so I am also an 'owner' of the hbrobotics repository. By accident, I checked in some untested changes into the hbrobotics web site, when I thought I was checking them into a staging repository. Me bad. This should get us back to the way we were at pull request #18. --- ros_arduino_python/config/arduino_params.yaml | 2 -- .../src/ros_arduino_python/arduino_driver.py | 22 ------------------- .../src/ros_arduino_python/base_controller.py | 5 +---- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/ros_arduino_python/config/arduino_params.yaml b/ros_arduino_python/config/arduino_params.yaml index 96513da..9acbe3d 100644 --- a/ros_arduino_python/config/arduino_params.yaml +++ b/ros_arduino_python/config/arduino_params.yaml @@ -22,8 +22,6 @@ base_frame: base_link #encoder_resolution: 8384 # from Pololu for 131:1 motors #gear_reduction: 1.0 #motors_reversed: True -#left_motor_reversed: True -#right_motor_reversed: True # === PID parameters #Kp: 10 diff --git a/ros_arduino_python/src/ros_arduino_python/arduino_driver.py b/ros_arduino_python/src/ros_arduino_python/arduino_driver.py index ab48748..f210d14 100755 --- a/ros_arduino_python/src/ros_arduino_python/arduino_driver.py +++ b/ros_arduino_python/src/ros_arduino_python/arduino_driver.py @@ -49,9 +49,6 @@ class Arduino: self.encoder_count = 0 self.writeTimeout = timeout self.interCharTimeout = timeout / 30. - self.motors_reversed = False - self.left_motor_reversed = False - self.right_motor_reversed = False # Keep things thread safe self.mutex = thread.allocate_lock() @@ -95,12 +92,6 @@ class Arduino: ''' self.port.close() - def motors_configure(self, motors_reversed = False, - left_motor_reversed = False, right_motor_reversed = False): - self.motors_reversed = motors_reversed - self.left_motor_reversed = left_motor_reversed - self.right_motor_reversed = right_motor_reversed - def send(self, cmd): ''' This command should not be used on its own: it is called by the execute commands below in a thread safe manner. @@ -276,12 +267,6 @@ class Arduino: raise SerialException return None else: - if self.motors_reversed: - values[0], values[1] = values[1], values[0] - if self.left_motor_reversed: - values[0] = -values[0] - if self.right_motor_reversed: - values[1] = -values[1] return values def reset_encoders(self): @@ -292,13 +277,6 @@ class Arduino: def drive(self, right, left): ''' Speeds are given in encoder ticks per PID interval ''' - if self.left_motor_reversed: - left = -left - if self.right_motor_reversed: - right = -right - if self.motors_reversed: - left, right = right, left - return self.execute_ack('m %d %d' %(right, left)) def drive_m_per_s(self, right, left): diff --git a/ros_arduino_python/src/ros_arduino_python/base_controller.py b/ros_arduino_python/src/ros_arduino_python/base_controller.py index 2d37526..813e873 100755 --- a/ros_arduino_python/src/ros_arduino_python/base_controller.py +++ b/ros_arduino_python/src/ros_arduino_python/base_controller.py @@ -50,10 +50,7 @@ class BaseController: self.accel_limit = rospy.get_param('~accel_limit', 0.1) self.motors_reversed = rospy.get_param("~motors_reversed", False) - self.left_motor_reversed = rospy.get_param("~left_motor_reversed", False) - self.right_motor_reversed = rospy.get_param("~right_motor_reversed", False) - arduino.motors_configure(self.motors_reversed, self.left_motor_reversed, self.right_motor_reversed) - + # Set up PID parameters and check for missing values self.setup_pid(pid_params)