Skip to content

Commit 672dd9c

Browse files
committed
260/270/280/myarm300使用pymycobot提示指定版本范围
1 parent 514b05a commit 672dd9c

File tree

78 files changed

+805
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+805
-109
lines changed

mecharm/mecharm/scripts/follow_display.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python3
22
# -*- coding:utf-8 -*-
33
import time
44

@@ -8,7 +8,17 @@
88
from visualization_msgs.msg import Marker
99

1010

11-
from pymycobot.mycobot import MyCobot
11+
import pymycobot
12+
from packaging import version
13+
# min low version require
14+
MAX_REQUIRE_VERSION = '3.5.3'
15+
current_verison = pymycobot.__version__
16+
print('current pymycobot library version: {}'.format(current_verison))
17+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
18+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
19+
else:
20+
print('pymycobot library version meets the requirements!')
21+
from pymycobot.mycobot import MyCobot
1222

1323

1424
def talker():

mecharm/mecharm/scripts/listen_real.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python3
22
# -*- coding:utf-8 -*-
33
# license removed for brevity
44
import time

mecharm/mecharm/scripts/slider_control.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@
1414
import rospy
1515
from sensor_msgs.msg import JointState
1616

17-
from pymycobot.mycobot import MyCobot
17+
import pymycobot
18+
from packaging import version
19+
# min low version require
20+
MAX_REQUIRE_VERSION = '3.5.3'
21+
current_verison = pymycobot.__version__
22+
print('current pymycobot library version: {}'.format(current_verison))
23+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
24+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
25+
else:
26+
print('pymycobot library version meets the requirements!')
27+
from pymycobot.mycobot import MyCobot
1828

1929

2030

mecharm/mecharm_communication/scripts/mecharm_services.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
import fcntl
77
from mycobot_communication.srv import *
88

9-
from pymycobot.mycobot import MyCobot
9+
import pymycobot
10+
from packaging import version
11+
# min low version require
12+
MAX_REQUIRE_VERSION = '3.5.3'
13+
current_verison = pymycobot.__version__
14+
print('current pymycobot library version: {}'.format(current_verison))
15+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
16+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
17+
else:
18+
print('pymycobot library version meets the requirements!')
19+
from pymycobot.mycobot import MyCobot
1020

1121
mc = None
1222

mecharm/mecharm_communication/scripts/mecharm_topics.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@
1717
MycobotPumpStatus,
1818
)
1919

20-
from pymycobot.mycobot import MyCobot
20+
import pymycobot
21+
from packaging import version
22+
# min low version require
23+
MAX_REQUIRE_VERSION = '3.5.3'
24+
current_verison = pymycobot.__version__
25+
print('current pymycobot library version: {}'.format(current_verison))
26+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
27+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
28+
else:
29+
print('pymycobot library version meets the requirements!')
30+
from pymycobot.mycobot import MyCobot
2131

2232

2333
class Watcher:

mecharm/mecharm_communication/scripts/mecharm_topics_jsnn.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,19 @@
1717
MycobotPumpStatus,
1818
)
1919

20-
21-
# from pymycobot import MyCobot
22-
23-
from pymycobot import MyCobotSocket # pi
20+
import pymycobot
21+
from packaging import version
22+
# min low version require
23+
MAX_REQUIRE_VERSION = '3.5.3'
24+
current_verison = pymycobot.__version__
25+
print('current pymycobot library version: {}'.format(current_verison))
26+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
27+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
28+
else:
29+
print('pymycobot library version meets the requirements!')
30+
# from pymycobot import MyCobot
31+
32+
from pymycobot import MyCobotSocket # pi
2433

2534

2635
class Watcher:

mecharm/mecharm_communication/scripts/mecharm_topics_pi.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python
22
# -*- coding:utf-8 -*-
33
import time
44
import os
@@ -17,7 +17,17 @@
1717
MycobotPumpStatus,
1818
)
1919

20-
from pymycobot import MyCobot
20+
import pymycobot
21+
from packaging import version
22+
# min low version require
23+
MAX_REQUIRE_VERSION = '3.5.3'
24+
current_verison = pymycobot.__version__
25+
print('current pymycobot library version: {}'.format(current_verison))
26+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
27+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
28+
else:
29+
print('pymycobot library version meets the requirements!')
30+
from pymycobot.mycobot import MyCobot
2131

2232
# from pymycobot import MyCobotSocket
2333

mecharm/mecharm_communication/scripts/mecharm_topics_seeed.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@
1818
)
1919

2020

21-
from pymycobot import MyCobot
21+
import pymycobot
22+
from packaging import version
23+
# min low version require
24+
MAX_REQUIRE_VERSION = '3.5.3'
25+
current_verison = pymycobot.__version__
26+
print('current pymycobot library version: {}'.format(current_verison))
27+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
28+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
29+
else:
30+
print('pymycobot library version meets the requirements!')
31+
from pymycobot.mycobot import MyCobot
2232

2333

2434
class Watcher:

mecharm/mecharm_moveit/scripts/sync_plan.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55
import rospy
66
from sensor_msgs.msg import JointState
77

8-
from pymycobot.mycobot import MyCobot
9-
# from pymycobot.mypalletizer import MyPalletizer
8+
import pymycobot
9+
from packaging import version
10+
# min low version require
11+
MAX_REQUIRE_VERSION = '3.5.3'
12+
current_verison = pymycobot.__version__
13+
print('current pymycobot library version: {}'.format(current_verison))
14+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
15+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
16+
else:
17+
print('pymycobot library version meets the requirements!')
18+
from pymycobot.mycobot import MyCobot
1019

1120

1221
mc = None

mecharm/mecharm_pi_moveit/scripts/sync_plan.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
import rospy
55
from sensor_msgs.msg import JointState
66

7-
from pymycobot.mycobot import MyCobot
7+
import pymycobot
8+
from packaging import version
9+
# min low version require
10+
MAX_REQUIRE_VERSION = '3.5.3'
11+
current_verison = pymycobot.__version__
12+
print('current pymycobot library version: {}'.format(current_verison))
13+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
14+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
15+
else:
16+
print('pymycobot library version meets the requirements!')
17+
from pymycobot.mycobot import MyCobot
818

919

1020
mc = None

myArm/myarm/scripts/follow_display.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
from std_msgs.msg import Header
77
from visualization_msgs.msg import Marker
88

9-
from pymycobot.myarm import MyArm
9+
import pymycobot
10+
from packaging import version
11+
# min low version require
12+
MAX_REQUIRE_VERSION = '3.5.3'
13+
current_verison = pymycobot.__version__
14+
print('current pymycobot library version: {}'.format(current_verison))
15+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
16+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
17+
else:
18+
print('pymycobot library version meets the requirements!')
19+
from pymycobot.myarm import MyArm
1020

1121

1222
def talker():

myArm/myarm/scripts/slider_control.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
import rospy
1414
from sensor_msgs.msg import JointState
1515

16-
from pymycobot.myarm import MyArm
16+
import pymycobot
17+
from packaging import version
18+
# min low version require
19+
MAX_REQUIRE_VERSION = '3.5.3'
20+
current_verison = pymycobot.__version__
21+
print('current pymycobot library version: {}'.format(current_verison))
22+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
23+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
24+
else:
25+
print('pymycobot library version meets the requirements!')
26+
from pymycobot.myarm import MyArm
1727

1828

1929
mc = None

myArm/myarm_communication/scripts/myarm_services.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@
55
import os
66
import fcntl
77
from myarm_communication.srv import *
8-
9-
from pymycobot.myarm import MyArm
10-
from pymycobot.myarmc import MyArmC
8+
import pymycobot
9+
from packaging import version
10+
# min low version require
11+
MAX_REQUIRE_VERSION = '3.5.3'
12+
current_verison = pymycobot.__version__
13+
print('current pymycobot library version: {}'.format(current_verison))
14+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
15+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
16+
else:
17+
print('pymycobot library version meets the requirements!')
18+
from pymycobot.myarm import MyArm
1119

1220
mc = None
1321

@@ -57,7 +65,7 @@ def create_handle():
5765
port = rospy.get_param("~port")
5866
baud = rospy.get_param("~baud")
5967
rospy.loginfo("%s,%s" % (port, baud))
60-
mc = MyArmC(port, baud)
68+
mc = MyArm(port, baud)
6169

6270

6371
def create_services():

myArm/myarm_communication/scripts/myarm_topics.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@
1717
MyArmPumpStatus,
1818
)
1919

20-
from pymycobot.myarm import MyArm
20+
import pymycobot
21+
from packaging import version
22+
# min low version require
23+
MAX_REQUIRE_VERSION = '3.5.3'
24+
current_verison = pymycobot.__version__
25+
print('current pymycobot library version: {}'.format(current_verison))
26+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
27+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
28+
else:
29+
print('pymycobot library version meets the requirements!')
30+
from pymycobot.myarm import MyArm
2131

2232

2333
class Watcher:

myArm/myarm_communication/scripts/myarm_topics_pi.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@
1717
MyArmPumpStatus,
1818
)
1919

20-
21-
from pymycobot import MyArm
22-
# from pymyarm import myarmSocket
20+
import pymycobot
21+
from packaging import version
22+
# min low version require
23+
MAX_REQUIRE_VERSION = '3.5.3'
24+
current_verison = pymycobot.__version__
25+
print('current pymycobot library version: {}'.format(current_verison))
26+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
27+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
28+
else:
29+
print('pymycobot library version meets the requirements!')
30+
from pymycobot.myarm import MyArm
2331

2432

2533
class Watcher:

myArm/myarm_moveit/scripts/sync_plan.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@
1414
import rospy
1515
from sensor_msgs.msg import JointState
1616

17-
from pymycobot.myarm import MyArm
17+
import pymycobot
18+
from packaging import version
19+
# min low version require
20+
MAX_REQUIRE_VERSION = '3.5.3'
21+
current_verison = pymycobot.__version__
22+
print('current pymycobot library version: {}'.format(current_verison))
23+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
24+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
25+
else:
26+
print('pymycobot library version meets the requirements!')
27+
from pymycobot.myarm import MyArm
1828

1929

2030
mc = None

mycobot_280/mycobot_280/scripts/follow_display.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
from std_msgs.msg import Header
77
from visualization_msgs.msg import Marker
88

9-
from pymycobot.mycobot import MyCobot
9+
import pymycobot
10+
from packaging import version
11+
# min low version require
12+
MAX_REQUIRE_VERSION = '3.5.3'
13+
current_verison = pymycobot.__version__
14+
print('current pymycobot library version: {}'.format(current_verison))
15+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
16+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
17+
else:
18+
print('pymycobot library version meets the requirements!')
19+
from pymycobot.mycobot import MyCobot
1020

1121

1222
def talker():

mycobot_280/mycobot_280/scripts/follow_display_gripper.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
from std_msgs.msg import Header
88
from visualization_msgs.msg import Marker
99

10-
from pymycobot.mycobot import MyCobot
10+
import pymycobot
11+
from packaging import version
12+
# min low version require
13+
MAX_REQUIRE_VERSION = '3.5.3'
14+
current_verison = pymycobot.__version__
15+
print('current pymycobot library version: {}'.format(current_verison))
16+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
17+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
18+
else:
19+
print('pymycobot library version meets the requirements!')
20+
from pymycobot.mycobot import MyCobot
1121

1222

1323
def talker():

mycobot_280/mycobot_280/scripts/listen_real_gripper.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,18 @@
1111
from sensor_msgs.msg import JointState
1212
from std_msgs.msg import Header
1313
from mycobot_communication.srv import GetAngles
14-
from pymycobot.mycobot import MyCobot
1514
from rospy import ServiceException
15+
import pymycobot
16+
from packaging import version
17+
# min low version require
18+
MAX_REQUIRE_VERSION = '3.5.3'
19+
current_verison = pymycobot.__version__
20+
print('current pymycobot library version: {}'.format(current_verison))
21+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
22+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
23+
else:
24+
print('pymycobot library version meets the requirements!')
25+
from pymycobot.mycobot import MyCobot
1626

1727
mc = None
1828

mycobot_280/mycobot_280/scripts/slider_control.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
import rospy
1414
from sensor_msgs.msg import JointState
1515

16-
from pymycobot.mycobot import MyCobot
16+
import pymycobot
17+
from packaging import version
18+
# min low version require
19+
MAX_REQUIRE_VERSION = '3.5.3'
20+
current_verison = pymycobot.__version__
21+
print('current pymycobot library version: {}'.format(current_verison))
22+
if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION):
23+
raise RuntimeError('The version of pymycobot library must be less than {} . The current version is {}. Please downgrade the library version.'.format(MAX_REQUIRE_VERSION, current_verison))
24+
else:
25+
print('pymycobot library version meets the requirements!')
26+
from pymycobot.mycobot import MyCobot
1727

1828

1929
mc = None

0 commit comments

Comments
 (0)