Skip to content

Commit 0f62dc0

Browse files
committed
fix JN drag trail teach can't find serial port bug
1 parent df8e03f commit 0f62dc0

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

demo/drag_trial_teaching.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
mc: MyCobot
1818
sp: int = 80
1919

20-
2120
def setup():
2221
global port, mc
2322

@@ -31,6 +30,17 @@ def setup():
3130
if _in == "1":
3231
robot_model = MyCobot
3332
print("MyCobot\n")
33+
print("Please enter the model type:")
34+
print("1. Pi")
35+
print("2. Jetson Nano")
36+
print("Default is Pi")
37+
model_type = input()
38+
39+
if model_type == "2":
40+
port = "/dev/ttyTHS1"
41+
else:
42+
pass
43+
3444
elif _in == "2":
3545
robot_model = MechArm
3646
print("MechArm\n")
@@ -48,10 +58,11 @@ def setup():
4858
print("{} : {}".format(idx, port))
4959
idx += 1
5060

51-
_in = input("\nPlease input 1 - {} to choice:".format(idx - 1))
52-
port = str(plist[int(_in) - 1]).split(" - ")[0].strip()
53-
print(port)
54-
print("")
61+
if port is None:
62+
_in = input("\nPlease input 1 - {} to choice:".format(idx - 1))
63+
port = str(plist[int(_in) - 1]).split(" - ")[0].strip()
64+
print(port)
65+
print("")
5566

5667
baud = 1000000
5768
_baud = input("Please input baud(default:1000000):")

0 commit comments

Comments
 (0)