mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 19:24:09 +05:30
Added missing resetEncoders() function to encoder_driver.ino
This commit is contained in:
parent
97946646d2
commit
d03061ae60
@ -33,6 +33,12 @@
|
||||
else return encoders.XAxisReset();
|
||||
}
|
||||
|
||||
/* Wrap the encoder reset function */
|
||||
void resetEncoders() {
|
||||
resetEncoder(LEFT);
|
||||
resetEncoder(RIGHT);
|
||||
}
|
||||
|
||||
#elif defined(ROBOGAIA_3_AXIS)
|
||||
/* Robogaia 3-axis encoder shield */
|
||||
|
||||
|
@ -100,10 +100,10 @@ class Arduino:
|
||||
attempts = 1
|
||||
|
||||
self.serial_port.write(cmd + '\r')
|
||||
|
||||
value = self.serial_port.readline().strip('\n')
|
||||
|
||||
while len(value) == 0 and attempts < max_attempts:
|
||||
print "Command", cmd, "failed", attempts, "time(s)"
|
||||
self.serial_port.write(cmd + '\r')
|
||||
value = self.serial_port.readline().strip('\n')
|
||||
attempts += 1
|
||||
@ -141,6 +141,8 @@ class Arduino:
|
||||
return None
|
||||
|
||||
def get_encoder_counts(self):
|
||||
''' Read the current encoder counts
|
||||
'''
|
||||
values = self.execute_array('e')
|
||||
|
||||
if len(values) != 2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user