mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
update
This commit is contained in:
parent
300cbd3a1c
commit
71f24b14c2
1 changed files with 23 additions and 9 deletions
|
|
@ -6,9 +6,10 @@ from pymycobot.genre import Angle
|
|||
from pymycobot import PI_PORT, PI_BAUD # 当使用树莓派版本的mycobot时,可以引用这两个变量进行MyCobot初始化
|
||||
import time,os
|
||||
|
||||
mc = MyCobot(os.popen("ls /dev/ttyUSB*").readline()[:-1], 115200)
|
||||
# mc = MyCobot(os.popen("ls /dev/ttyUSB*").readline()[:-1], 115200)
|
||||
# mc = MyCobot(os.popen("ls /dev/ttyACM*").readline()[:-1], 115200)
|
||||
# mc = MyCobot("/dev/ttyAMA0", 1000000)
|
||||
mc = MyCobot(PI_PORT,PI_BAUD)
|
||||
|
||||
|
||||
# mc.send_angles([0,0,0,0,90,0],20) # coords:[95.6, 0.5, 166.4, 179.12, -0.18, 179.46]
|
||||
|
|
@ -41,22 +42,35 @@ mc = MyCobot(os.popen("ls /dev/ttyUSB*").readline()[:-1], 115200)
|
|||
# print("\n")
|
||||
|
||||
# mc.release_all_servos()
|
||||
# mc.release_servo(1)
|
||||
mc.release_servo(2)
|
||||
# mc.set_servo_calibration(1)
|
||||
# mc.set_servo_calibration(2)
|
||||
mc.set_servo_calibration(2)
|
||||
# mc.set_servo_calibration(3)
|
||||
# mc.set_servo_calibration(4)
|
||||
# mc.set_servo_calibration(5)
|
||||
# mc.set_servo_calibration(6)
|
||||
|
||||
|
||||
mc.set_basic_output(2, 0)
|
||||
mc.set_basic_output(5, 0)
|
||||
time.sleep(3)
|
||||
# mc.set_basic_output(2, 0)
|
||||
# mc.set_basic_output(5, 0)
|
||||
# time.sleep(3)
|
||||
|
||||
mc.set_basic_output(2, 1)
|
||||
mc.set_basic_output(5, 1)
|
||||
time.sleep(3)
|
||||
# mc.set_basic_output(2, 1)
|
||||
# mc.set_basic_output(5, 1)
|
||||
# time.sleep(3)
|
||||
|
||||
# print(mc.get_basic_input(2))
|
||||
# print(mc.get_basic_input(5))
|
||||
|
||||
# import RPi.GPIO as GPIO
|
||||
# GPIO.setwarnings(False)
|
||||
# GPIO.setmode(GPIO.BCM)
|
||||
# GPIO.setup(20, GPIO.OUT)
|
||||
# GPIO.setup(21, GPIO.OUT)
|
||||
|
||||
# GPIO.output(20, 0)
|
||||
# GPIO.output(21, 0)
|
||||
# time.sleep(3)
|
||||
|
||||
# GPIO.output(20, 1)
|
||||
# GPIO.output(21, 1)
|
||||
Loading…
Add table
Reference in a new issue