mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 19:24:09 +05:30
Removed min/max check on servo_write since the range 0-180 does not apply to all joint types
This commit is contained in:
parent
3e6ab35cbf
commit
c2614fc25e
@ -29,9 +29,6 @@ import sys, traceback
|
|||||||
from serial.serialutil import SerialException
|
from serial.serialutil import SerialException
|
||||||
from serial import Serial
|
from serial import Serial
|
||||||
|
|
||||||
SERVO_MAX = 180
|
|
||||||
SERVO_MIN = 0
|
|
||||||
|
|
||||||
class Arduino:
|
class Arduino:
|
||||||
''' Configuration Parameters
|
''' Configuration Parameters
|
||||||
'''
|
'''
|
||||||
@ -318,7 +315,7 @@ class Arduino:
|
|||||||
''' Usage: servo_write(id, pos)
|
''' Usage: servo_write(id, pos)
|
||||||
Position is given in radians and converted to degrees before sending
|
Position is given in radians and converted to degrees before sending
|
||||||
'''
|
'''
|
||||||
return self.execute_ack('s %d %d' %(id, min(SERVO_MAX, max(SERVO_MIN, degrees(pos)))))
|
return self.execute_ack('s %d %d' %(id, degrees(pos)))
|
||||||
|
|
||||||
def servo_read(self, id):
|
def servo_read(self, id):
|
||||||
''' Usage: servo_read(id)
|
''' Usage: servo_read(id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user