mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
fix: Add complement zero of speed in send_angle function.
This commit is contained in:
parent
e6fcc676c5
commit
cc9c7151b6
2 changed files with 6 additions and 4 deletions
|
|
@ -94,7 +94,8 @@ class MyCobot():
|
|||
|
||||
'''
|
||||
_hex = self._angle_to_hex(degree)
|
||||
command = 'fefe0621{}{}{}fa'.format(id, _hex, hex(speed)[2:])
|
||||
speed = self._complement_zero(hex(speed)[2:], digit=2)
|
||||
command = 'fefe0621{}{}{}fa'.format(id, _hex, speed)
|
||||
# print(command)
|
||||
self._write(command)
|
||||
|
||||
|
|
@ -353,4 +354,4 @@ class MyCobot():
|
|||
|
||||
def _read(self, size=1024):
|
||||
data = self.serial_port.read(size)
|
||||
return data
|
||||
return data
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ class MyCobot():
|
|||
|
||||
'''
|
||||
_hex = self._angle_to_hex(degree)
|
||||
command = 'fefe0621{}{}{}fa'.format(id, _hex, hex(speed)[2:])
|
||||
speed = self._complement_zero(hex(speed)[2:], digit=2)
|
||||
command = 'fefe0621{}{}{}fa'.format(id, _hex, speed)
|
||||
# print(command)
|
||||
self._write(command)
|
||||
|
||||
|
|
@ -354,4 +355,4 @@ class MyCobot():
|
|||
|
||||
def _read(self, size: int=1024):
|
||||
data = self.serial_port.read(size)
|
||||
return data
|
||||
return data
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue