-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
158 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import time | ||
from pymycobot.mycobot import MyCobot | ||
|
||
|
||
from pymycobot import * | ||
import time | ||
import datetime | ||
m = MyCobot('/dev/ttyUSB0', 115200) | ||
time.sleep(2) | ||
delay_time = 0.1 | ||
run_delay_time = 1 | ||
angles = [0,0,0,0,0,0] | ||
coords = [0,0,0,0,0,0] | ||
angle_loss_count = 0 | ||
coord_loss_count = 0 | ||
total_count = 0 | ||
send_angles = [[0,0,0,0,0,0], [0,0,0,0,20,20]] | ||
sp = 50 | ||
# m = MyCobot("com64", 115200) | ||
|
||
# time.sleep(2) #open port,need wait | ||
# print(m.get_radians()) | ||
while 1: | ||
for i in range(len(send_angles)) : | ||
angles = m.get_angles() | ||
if (angles is None): | ||
angle_loss_count = angle_loss_count + 1 | ||
#angles = m.get_angles() | ||
time.sleep(delay_time) | ||
coords = m.get_coords() | ||
if (coords is None): | ||
coord_loss_count = coord_loss_count + 1 | ||
#coords = m.get_coords() | ||
time.sleep(delay_time) | ||
m.send_angles(send_angles[i], sp) | ||
time.sleep(run_delay_time) | ||
total_count = total_count + 1 | ||
now = datetime.datetime.now() | ||
print(now, "angles, coords ", angles, coords, angle_loss_count, coord_loss_count, total_count) | ||
time.sleep(delay_time) |
Oops, something went wrong.