Merge pull request #7 from OTL/serial

Add `serial` as dependencies in package.xml
This commit is contained in:
Zachary 2021-01-28 16:40:21 +08:00 committed by 张立军
commit 013714521e
2 changed files with 8 additions and 6 deletions

View file

@ -14,10 +14,12 @@
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>serial</build_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>serial</exec_depend>
<!-- The export tag contains other, unspecified, tags -->

View file

@ -1,7 +1,7 @@
import time, random, subprocess
from pymycobot.mycobot import MyCobot
# from pythonAPI.mycobot3 import MyCobot as MyCobot3
from pymycobot.common import Angle, Coord
from pymycobot.genre import Angle, Coord
if __name__ == '__main__':
port = subprocess.check_output(['echo -n /dev/ttyUSB*'],
@ -27,18 +27,18 @@ if __name__ == '__main__':
print('==> degrees: {}\n'.format(mycobot.get_angles()))
time.sleep(0.5)
print('::get_angles_of_radian()')
print('==> radians: {}\n'.format(mycobot.get_angles_of_radian()))
print('::get_radians()')
print('==> radians: {}\n'.format(mycobot.get_radians()))
time.sleep(0.5)
print('::send_angles()')
mycobot.send_angles([0,0,0,0,0,0], 80)
print('==> set angles [0,0,0,0,0,0], speed 80\n')
print('Is moving: {}'.format(mycobot.is_moving()))
time.sleep(3)
print('::send_angles_by_radian')
mycobot.send_angles_by_radian([1,1,1,1,1,1], 70)
print('::send_radians')
mycobot.send_radians([1,1,1,1,1,1], 70)
print('==> set raidans [1,1,1,1,1,1], speed 70\n')
time.sleep(1.5)