From 672dd9cb4b57bd0ff3a9fcf748feff04558cbc71 Mon Sep 17 00:00:00 2001 From: wangWking <842749351@qq.com> Date: Fri, 27 Dec 2024 16:53:32 +0800 Subject: [PATCH] =?UTF-8?q?260/270/280/myarm300=E4=BD=BF=E7=94=A8pymycobot?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=8C=87=E5=AE=9A=E7=89=88=E6=9C=AC=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mecharm/mecharm/scripts/follow_display.py | 14 ++++++++++++-- mecharm/mecharm/scripts/listen_real.py | 2 +- mecharm/mecharm/scripts/slider_control.py | 12 +++++++++++- .../scripts/mecharm_services.py | 12 +++++++++++- .../scripts/mecharm_topics.py | 12 +++++++++++- .../scripts/mecharm_topics_jsnn.py | 17 +++++++++++++---- .../scripts/mecharm_topics_pi.py | 14 ++++++++++++-- .../scripts/mecharm_topics_seeed.py | 12 +++++++++++- mecharm/mecharm_moveit/scripts/sync_plan.py | 13 +++++++++++-- mecharm/mecharm_pi_moveit/scripts/sync_plan.py | 12 +++++++++++- myArm/myarm/scripts/follow_display.py | 12 +++++++++++- myArm/myarm/scripts/slider_control.py | 12 +++++++++++- .../scripts/myarm_services.py | 16 ++++++++++++---- .../myarm_communication/scripts/myarm_topics.py | 12 +++++++++++- .../scripts/myarm_topics_pi.py | 14 +++++++++++--- myArm/myarm_moveit/scripts/sync_plan.py | 12 +++++++++++- .../mycobot_280/scripts/follow_display.py | 12 +++++++++++- .../scripts/follow_display_gripper.py | 12 +++++++++++- .../mycobot_280/scripts/listen_real_gripper.py | 12 +++++++++++- .../mycobot_280/scripts/slider_control.py | 12 +++++++++++- .../scripts/slider_control_gripper.py | 12 +++++++++++- .../scripts/sync_plan.py | 12 +++++++++++- .../mycobot_280_moveit/scripts/sync_plan.py | 12 +++++++++++- .../scripts/follow_display.py | 12 +++++++++++- .../scripts/slider_control.py | 12 +++++++++++- mycobot_280/mycobot_280arduino/scripts/test.py | 12 +++++++++++- .../scripts/sync_plan.py | 12 +++++++++++- .../mycobot_280jn/scripts/follow_display.py | 17 +++++++++++++---- .../mycobot_280jn/scripts/slider_control.py | 14 ++++++++++++-- .../scripts/slider_control_gripper.py | 12 +++++++++++- .../scripts/slider_control_parallel_gripper.py | 12 +++++++++++- mycobot_280/mycobot_280jn/scripts/test.py | 14 ++++++++++++-- .../scripts/sync_plan.py | 12 +++++++++++- .../mycobot_280jn_moveit/scripts/sync_plan.py | 12 +++++++++++- .../mycobot_280pi/scripts/follow_display.py | 12 +++++++++++- .../mycobot_280pi/scripts/slider_control.py | 12 +++++++++++- .../mycobot_280pi_moveit/scripts/sync_plan.py | 12 +++++++++++- .../scripts/mycobot_320_follow_display.py | 2 +- .../scripts/mycobot_320_gripper_slider.py | 2 +- .../mycobot_320/scripts/mycobot_320_slider.py | 2 +- .../scripts/mycobot_services.py | 2 +- .../scripts/mycobot_topics.py | 12 +++++++++++- .../scripts/mycobot_topics_jsnn.py | 17 +++++++++++++---- .../scripts/mycobot_topics_pi.py | 12 +++++++++++- .../scripts/mycobot_topics_seeed.py | 12 +++++++++++- .../scripts/sync_plan.py | 2 +- .../mycobot_320_moveit/scripts/sync_plan.py | 2 +- .../scripts/advance_detect_obj_color.py | 12 +++++++++++- .../scripts/advance_detect_obj_img_folder.py | 12 +++++++++++- .../scripts/combine_detect_obj_color.py | 12 +++++++++++- .../combine_detect_obj_img_folder_opt.py | 12 +++++++++++- mycobot_ai/aikit_280_pi/scripts/aikit_color.py | 12 +++++++++++- mycobot_ai/aikit_280_pi/scripts/aikit_encode.py | 12 +++++++++++- mycobot_ai/aikit_280_pi/scripts/aikit_img.py | 12 +++++++++++- mycobot_ai/aikit_280_pi/scripts/aikit_shape.py | 12 +++++++++++- mycobot_ai/aikit_320_pi/scripts/aikit_color.py | 12 +++++++++++- mycobot_ai/aikit_320_pi/scripts/aikit_encode.py | 12 +++++++++++- .../aikit_320_pi/scripts/aikit_gripper_color.py | 12 +++++++++++- .../scripts/aikit_gripper_encode.py | 12 +++++++++++- mycobot_ai/aikit_320_pi/scripts/aikit_img.py | 12 +++++++++++- mycobot_ai/aikit_320_pi/scripts/aikit_object.py | 12 +++++++++++- mycobot_ai/aikit_320_pi/scripts/aikit_shape.py | 12 +++++++++++- .../scripts/mycobot_services.py | 12 +++++++++++- mycobot_communication/scripts/mycobot_topics.py | 12 +++++++++++- .../scripts/mycobot_topics_jsnn.py | 17 +++++++++++++---- .../scripts/mycobot_topics_pi.py | 15 ++++++++++++--- .../scripts/mycobot_topics_seeed.py | 12 +++++++++++- .../mypalletizer_260/scripts/follow_display.py | 12 +++++++++++- .../mypalletizer_260/scripts/slider_control.py | 14 ++++++++++++-- .../scripts/sync_plan.py | 13 +++++++++++-- .../scripts/follow_display.py | 14 ++++++++++++-- .../scripts/slider_control.py | 14 ++++++++++++-- .../scripts/sync_plan.py | 13 +++++++++++-- .../scripts/mypal_services.py | 13 +++++++++++-- .../scripts/mypal_topics.py | 13 +++++++++++-- .../scripts/mypal_topics_pi.py | 12 +++++++++++- .../scripts/mypal_topics_seeed.py | 12 +++++++++++- .../mypalletizer_communication/scripts/test.py | 12 +++++++++++- 78 files changed, 805 insertions(+), 109 deletions(-) diff --git a/mecharm/mecharm/scripts/follow_display.py b/mecharm/mecharm/scripts/follow_display.py index 3b1fe8b1..7b2523a6 100755 --- a/mecharm/mecharm/scripts/follow_display.py +++ b/mecharm/mecharm/scripts/follow_display.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding:utf-8 -*- import time @@ -8,7 +8,17 @@ from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot def talker(): diff --git a/mecharm/mecharm/scripts/listen_real.py b/mecharm/mecharm/scripts/listen_real.py index 9eb29195..efe72ff1 100755 --- a/mecharm/mecharm/scripts/listen_real.py +++ b/mecharm/mecharm/scripts/listen_real.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding:utf-8 -*- # license removed for brevity import time diff --git a/mecharm/mecharm/scripts/slider_control.py b/mecharm/mecharm/scripts/slider_control.py index 27ab9087..94afcee7 100755 --- a/mecharm/mecharm/scripts/slider_control.py +++ b/mecharm/mecharm/scripts/slider_control.py @@ -14,7 +14,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot diff --git a/mecharm/mecharm_communication/scripts/mecharm_services.py b/mecharm/mecharm_communication/scripts/mecharm_services.py index aa1e0262..274d7a09 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_services.py +++ b/mecharm/mecharm_communication/scripts/mecharm_services.py @@ -6,7 +6,17 @@ import fcntl from mycobot_communication.srv import * -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mecharm/mecharm_communication/scripts/mecharm_topics.py b/mecharm/mecharm_communication/scripts/mecharm_topics.py index 5039b0de..21eae738 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_topics.py +++ b/mecharm/mecharm_communication/scripts/mecharm_topics.py @@ -17,7 +17,17 @@ MycobotPumpStatus, ) -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot class Watcher: diff --git a/mecharm/mecharm_communication/scripts/mecharm_topics_jsnn.py b/mecharm/mecharm_communication/scripts/mecharm_topics_jsnn.py index 07304f88..ab0fe798 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_topics_jsnn.py +++ b/mecharm/mecharm_communication/scripts/mecharm_topics_jsnn.py @@ -17,10 +17,19 @@ MycobotPumpStatus, ) - -# from pymycobot import MyCobot - -from pymycobot import MyCobotSocket # pi +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + # from pymycobot import MyCobot + + from pymycobot import MyCobotSocket # pi class Watcher: diff --git a/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py b/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py index 857650c9..c7c64901 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py +++ b/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # -*- coding:utf-8 -*- import time import os @@ -17,7 +17,17 @@ MycobotPumpStatus, ) -from pymycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot # from pymycobot import MyCobotSocket diff --git a/mecharm/mecharm_communication/scripts/mecharm_topics_seeed.py b/mecharm/mecharm_communication/scripts/mecharm_topics_seeed.py index d1e8154d..a20c11f8 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_topics_seeed.py +++ b/mecharm/mecharm_communication/scripts/mecharm_topics_seeed.py @@ -18,7 +18,17 @@ ) -from pymycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot class Watcher: diff --git a/mecharm/mecharm_moveit/scripts/sync_plan.py b/mecharm/mecharm_moveit/scripts/sync_plan.py index e51431d6..5a15c29a 100755 --- a/mecharm/mecharm_moveit/scripts/sync_plan.py +++ b/mecharm/mecharm_moveit/scripts/sync_plan.py @@ -5,8 +5,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot -# from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mecharm/mecharm_pi_moveit/scripts/sync_plan.py b/mecharm/mecharm_pi_moveit/scripts/sync_plan.py index 57bf3761..6edaebf3 100755 --- a/mecharm/mecharm_pi_moveit/scripts/sync_plan.py +++ b/mecharm/mecharm_pi_moveit/scripts/sync_plan.py @@ -4,7 +4,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/myArm/myarm/scripts/follow_display.py b/myArm/myarm/scripts/follow_display.py index afe43937..fd362455 100755 --- a/myArm/myarm/scripts/follow_display.py +++ b/myArm/myarm/scripts/follow_display.py @@ -6,7 +6,17 @@ from std_msgs.msg import Header from visualization_msgs.msg import Marker -from pymycobot.myarm import MyArm +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.myarm import MyArm def talker(): diff --git a/myArm/myarm/scripts/slider_control.py b/myArm/myarm/scripts/slider_control.py index 41dad90e..4ab1d519 100755 --- a/myArm/myarm/scripts/slider_control.py +++ b/myArm/myarm/scripts/slider_control.py @@ -13,7 +13,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.myarm import MyArm +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.myarm import MyArm mc = None diff --git a/myArm/myarm_communication/scripts/myarm_services.py b/myArm/myarm_communication/scripts/myarm_services.py index 832d70da..e84c12ac 100755 --- a/myArm/myarm_communication/scripts/myarm_services.py +++ b/myArm/myarm_communication/scripts/myarm_services.py @@ -5,9 +5,17 @@ import os import fcntl from myarm_communication.srv import * - -from pymycobot.myarm import MyArm -from pymycobot.myarmc import MyArmC +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.myarm import MyArm mc = None @@ -57,7 +65,7 @@ def create_handle(): port = rospy.get_param("~port") baud = rospy.get_param("~baud") rospy.loginfo("%s,%s" % (port, baud)) - mc = MyArmC(port, baud) + mc = MyArm(port, baud) def create_services(): diff --git a/myArm/myarm_communication/scripts/myarm_topics.py b/myArm/myarm_communication/scripts/myarm_topics.py index 9b84e370..80f88a96 100755 --- a/myArm/myarm_communication/scripts/myarm_topics.py +++ b/myArm/myarm_communication/scripts/myarm_topics.py @@ -17,7 +17,17 @@ MyArmPumpStatus, ) -from pymycobot.myarm import MyArm +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.myarm import MyArm class Watcher: diff --git a/myArm/myarm_communication/scripts/myarm_topics_pi.py b/myArm/myarm_communication/scripts/myarm_topics_pi.py index 89e9ed26..1dfe9acd 100755 --- a/myArm/myarm_communication/scripts/myarm_topics_pi.py +++ b/myArm/myarm_communication/scripts/myarm_topics_pi.py @@ -17,9 +17,17 @@ MyArmPumpStatus, ) - -from pymycobot import MyArm -# from pymyarm import myarmSocket +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.myarm import MyArm class Watcher: diff --git a/myArm/myarm_moveit/scripts/sync_plan.py b/myArm/myarm_moveit/scripts/sync_plan.py index 8534420b..45c55bd1 100755 --- a/myArm/myarm_moveit/scripts/sync_plan.py +++ b/myArm/myarm_moveit/scripts/sync_plan.py @@ -14,7 +14,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.myarm import MyArm +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.myarm import MyArm mc = None diff --git a/mycobot_280/mycobot_280/scripts/follow_display.py b/mycobot_280/mycobot_280/scripts/follow_display.py index 75e2bc14..f3911ed5 100755 --- a/mycobot_280/mycobot_280/scripts/follow_display.py +++ b/mycobot_280/mycobot_280/scripts/follow_display.py @@ -6,7 +6,17 @@ from std_msgs.msg import Header from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot def talker(): diff --git a/mycobot_280/mycobot_280/scripts/follow_display_gripper.py b/mycobot_280/mycobot_280/scripts/follow_display_gripper.py index a07fc120..ebdd1165 100755 --- a/mycobot_280/mycobot_280/scripts/follow_display_gripper.py +++ b/mycobot_280/mycobot_280/scripts/follow_display_gripper.py @@ -7,7 +7,17 @@ from std_msgs.msg import Header from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot def talker(): diff --git a/mycobot_280/mycobot_280/scripts/listen_real_gripper.py b/mycobot_280/mycobot_280/scripts/listen_real_gripper.py index f3ac6376..c3f07df6 100755 --- a/mycobot_280/mycobot_280/scripts/listen_real_gripper.py +++ b/mycobot_280/mycobot_280/scripts/listen_real_gripper.py @@ -11,8 +11,18 @@ from sensor_msgs.msg import JointState from std_msgs.msg import Header from mycobot_communication.srv import GetAngles -from pymycobot.mycobot import MyCobot from rospy import ServiceException +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280/scripts/slider_control.py b/mycobot_280/mycobot_280/scripts/slider_control.py index b5fb85b9..7de629ee 100755 --- a/mycobot_280/mycobot_280/scripts/slider_control.py +++ b/mycobot_280/mycobot_280/scripts/slider_control.py @@ -13,7 +13,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280/scripts/slider_control_gripper.py b/mycobot_280/mycobot_280/scripts/slider_control_gripper.py index 951d49fe..60e39050 100755 --- a/mycobot_280/mycobot_280/scripts/slider_control_gripper.py +++ b/mycobot_280/mycobot_280/scripts/slider_control_gripper.py @@ -12,7 +12,17 @@ import time import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280_gripper_moveit/scripts/sync_plan.py b/mycobot_280/mycobot_280_gripper_moveit/scripts/sync_plan.py index d0aa2472..20fd63a8 100755 --- a/mycobot_280/mycobot_280_gripper_moveit/scripts/sync_plan.py +++ b/mycobot_280/mycobot_280_gripper_moveit/scripts/sync_plan.py @@ -3,7 +3,17 @@ import time import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot def callback(data): diff --git a/mycobot_280/mycobot_280_moveit/scripts/sync_plan.py b/mycobot_280/mycobot_280_moveit/scripts/sync_plan.py index 69ecd2af..c210a0f1 100644 --- a/mycobot_280/mycobot_280_moveit/scripts/sync_plan.py +++ b/mycobot_280/mycobot_280_moveit/scripts/sync_plan.py @@ -4,7 +4,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280arduino/scripts/follow_display.py b/mycobot_280/mycobot_280arduino/scripts/follow_display.py index 5915b599..7a350a92 100644 --- a/mycobot_280/mycobot_280arduino/scripts/follow_display.py +++ b/mycobot_280/mycobot_280arduino/scripts/follow_display.py @@ -6,7 +6,17 @@ from std_msgs.msg import Header from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot def talker(): diff --git a/mycobot_280/mycobot_280arduino/scripts/slider_control.py b/mycobot_280/mycobot_280arduino/scripts/slider_control.py index de9941a7..2a2c9d4d 100644 --- a/mycobot_280/mycobot_280arduino/scripts/slider_control.py +++ b/mycobot_280/mycobot_280arduino/scripts/slider_control.py @@ -13,7 +13,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280arduino/scripts/test.py b/mycobot_280/mycobot_280arduino/scripts/test.py index c676afa6..2c8976c8 100644 --- a/mycobot_280/mycobot_280arduino/scripts/test.py +++ b/mycobot_280/mycobot_280arduino/scripts/test.py @@ -1,5 +1,15 @@ import time -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot from pymycobot import * diff --git a/mycobot_280/mycobot_280arduino_moveit/scripts/sync_plan.py b/mycobot_280/mycobot_280arduino_moveit/scripts/sync_plan.py index 8ab140b7..1219233d 100644 --- a/mycobot_280/mycobot_280arduino_moveit/scripts/sync_plan.py +++ b/mycobot_280/mycobot_280arduino_moveit/scripts/sync_plan.py @@ -4,7 +4,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280jn/scripts/follow_display.py b/mycobot_280/mycobot_280jn/scripts/follow_display.py index fe7ffa60..ac926c0c 100755 --- a/mycobot_280/mycobot_280jn/scripts/follow_display.py +++ b/mycobot_280/mycobot_280jn/scripts/follow_display.py @@ -6,10 +6,19 @@ from sensor_msgs.msg import JointState from std_msgs.msg import Header from visualization_msgs.msg import Marker - -from pymycobot.mycobot import MyCobot - -from pymycobot import MyCobotSocket +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot + + from pymycobot import MyCobotSocket def talker(): rospy.init_node("display", anonymous=True) diff --git a/mycobot_280/mycobot_280jn/scripts/slider_control.py b/mycobot_280/mycobot_280jn/scripts/slider_control.py index 6fe105ec..c001436b 100755 --- a/mycobot_280/mycobot_280jn/scripts/slider_control.py +++ b/mycobot_280/mycobot_280jn/scripts/slider_control.py @@ -13,8 +13,18 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot -from pymycobot.mycobotsocket import MyCobotSocket +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot + from pymycobot.mycobotsocket import MyCobotSocket mc = None diff --git a/mycobot_280/mycobot_280jn/scripts/slider_control_gripper.py b/mycobot_280/mycobot_280jn/scripts/slider_control_gripper.py index bfdf9714..569d01ae 100755 --- a/mycobot_280/mycobot_280jn/scripts/slider_control_gripper.py +++ b/mycobot_280/mycobot_280jn/scripts/slider_control_gripper.py @@ -13,7 +13,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280jn/scripts/slider_control_parallel_gripper.py b/mycobot_280/mycobot_280jn/scripts/slider_control_parallel_gripper.py index 93cb5259..12c92af1 100644 --- a/mycobot_280/mycobot_280jn/scripts/slider_control_parallel_gripper.py +++ b/mycobot_280/mycobot_280jn/scripts/slider_control_parallel_gripper.py @@ -13,7 +13,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280jn/scripts/test.py b/mycobot_280/mycobot_280jn/scripts/test.py index 55350228..abacf94c 100755 --- a/mycobot_280/mycobot_280jn/scripts/test.py +++ b/mycobot_280/mycobot_280jn/scripts/test.py @@ -1,7 +1,17 @@ # encoding=utf-8 import time -from pymycobot.mycobotsocket import MyCobotSocket -# from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobotsocket import MyCobotSocket + # from pymycobot.mycobot import MyCobot # ms.send_angles([50,0,0,0,0,0],50) diff --git a/mycobot_280/mycobot_280jn_gripper_moveit/scripts/sync_plan.py b/mycobot_280/mycobot_280jn_gripper_moveit/scripts/sync_plan.py index bfdf9714..569d01ae 100644 --- a/mycobot_280/mycobot_280jn_gripper_moveit/scripts/sync_plan.py +++ b/mycobot_280/mycobot_280jn_gripper_moveit/scripts/sync_plan.py @@ -13,7 +13,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280jn_moveit/scripts/sync_plan.py b/mycobot_280/mycobot_280jn_moveit/scripts/sync_plan.py index 01eb2722..11620669 100644 --- a/mycobot_280/mycobot_280jn_moveit/scripts/sync_plan.py +++ b/mycobot_280/mycobot_280jn_moveit/scripts/sync_plan.py @@ -4,7 +4,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280pi/scripts/follow_display.py b/mycobot_280/mycobot_280pi/scripts/follow_display.py index 6fbd70a8..3c4dd953 100755 --- a/mycobot_280/mycobot_280pi/scripts/follow_display.py +++ b/mycobot_280/mycobot_280pi/scripts/follow_display.py @@ -7,7 +7,17 @@ from std_msgs.msg import Header from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot def talker(): diff --git a/mycobot_280/mycobot_280pi/scripts/slider_control.py b/mycobot_280/mycobot_280pi/scripts/slider_control.py index dd884cb5..6b132484 100755 --- a/mycobot_280/mycobot_280pi/scripts/slider_control.py +++ b/mycobot_280/mycobot_280pi/scripts/slider_control.py @@ -14,7 +14,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_280/mycobot_280pi_moveit/scripts/sync_plan.py b/mycobot_280/mycobot_280pi_moveit/scripts/sync_plan.py index e358b08d..cf6d13d7 100644 --- a/mycobot_280/mycobot_280pi_moveit/scripts/sync_plan.py +++ b/mycobot_280/mycobot_280pi_moveit/scripts/sync_plan.py @@ -5,7 +5,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_320/mycobot_320/scripts/mycobot_320_follow_display.py b/mycobot_320/mycobot_320/scripts/mycobot_320_follow_display.py index 30e641c7..829bf925 100755 --- a/mycobot_320/mycobot_320/scripts/mycobot_320_follow_display.py +++ b/mycobot_320/mycobot_320/scripts/mycobot_320_follow_display.py @@ -11,7 +11,7 @@ from packaging import version # min low version require -MAX_REQUIRE_VERSION = '3.6.0' +MAX_REQUIRE_VERSION = '3.5.3' current_verison = pymycobot.__version__ print('current pymycobot library version: {}'.format(current_verison)) diff --git a/mycobot_320/mycobot_320/scripts/mycobot_320_gripper_slider.py b/mycobot_320/mycobot_320/scripts/mycobot_320_gripper_slider.py index 71f90ec5..a6adb392 100755 --- a/mycobot_320/mycobot_320/scripts/mycobot_320_gripper_slider.py +++ b/mycobot_320/mycobot_320/scripts/mycobot_320_gripper_slider.py @@ -17,7 +17,7 @@ from packaging import version # min low version require -MAX_REQUIRE_VERSION = '3.6.0' +MAX_REQUIRE_VERSION = '3.5.3' current_verison = pymycobot.__version__ print('current pymycobot library version: {}'.format(current_verison)) diff --git a/mycobot_320/mycobot_320/scripts/mycobot_320_slider.py b/mycobot_320/mycobot_320/scripts/mycobot_320_slider.py index dc53e45e..e752c100 100755 --- a/mycobot_320/mycobot_320/scripts/mycobot_320_slider.py +++ b/mycobot_320/mycobot_320/scripts/mycobot_320_slider.py @@ -16,7 +16,7 @@ from packaging import version # min low version require -MAX_REQUIRE_VERSION = '3.6.0' +MAX_REQUIRE_VERSION = '3.5.3' current_verison = pymycobot.__version__ print('current pymycobot library version: {}'.format(current_verison)) diff --git a/mycobot_320/mycobot_320_communication/scripts/mycobot_services.py b/mycobot_320/mycobot_320_communication/scripts/mycobot_services.py index 95bb0318..a9ce63da 100755 --- a/mycobot_320/mycobot_320_communication/scripts/mycobot_services.py +++ b/mycobot_320/mycobot_320_communication/scripts/mycobot_services.py @@ -10,7 +10,7 @@ from packaging import version # min low version require -MAX_REQUIRE_VERSION = '3.6.0' +MAX_REQUIRE_VERSION = '3.5.3' current_verison = pymycobot.__version__ print('current pymycobot library version: {}'.format(current_verison)) diff --git a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics.py b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics.py index f17d1035..e108d422 100755 --- a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics.py +++ b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics.py @@ -17,7 +17,17 @@ MycobotPumpStatus, ) -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot class Watcher: diff --git a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_jsnn.py b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_jsnn.py index b4f77f25..5b531a14 100755 --- a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_jsnn.py +++ b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_jsnn.py @@ -17,10 +17,19 @@ MycobotPumpStatus, ) - -# from pymycobot import MyCobot - -from pymycobot import MyCobotSocket # pi +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + # from pymycobot import MyCobot + + from pymycobot import MyCobotSocket # pi class Watcher: diff --git a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py index 146dfb31..ef141fad 100755 --- a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py +++ b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py @@ -20,7 +20,17 @@ -from pymycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot # Avoid serial port conflicts and need to be locked diff --git a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_seeed.py b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_seeed.py index 85886291..184dd217 100755 --- a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_seeed.py +++ b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_seeed.py @@ -18,7 +18,17 @@ ) -from pymycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot class Watcher: diff --git a/mycobot_320/mycobot_320_gripper_moveit/scripts/sync_plan.py b/mycobot_320/mycobot_320_gripper_moveit/scripts/sync_plan.py index 71f90ec5..a6adb392 100755 --- a/mycobot_320/mycobot_320_gripper_moveit/scripts/sync_plan.py +++ b/mycobot_320/mycobot_320_gripper_moveit/scripts/sync_plan.py @@ -17,7 +17,7 @@ from packaging import version # min low version require -MAX_REQUIRE_VERSION = '3.6.0' +MAX_REQUIRE_VERSION = '3.5.3' current_verison = pymycobot.__version__ print('current pymycobot library version: {}'.format(current_verison)) diff --git a/mycobot_320/mycobot_320_moveit/scripts/sync_plan.py b/mycobot_320/mycobot_320_moveit/scripts/sync_plan.py index 87782a0e..0c260ab0 100755 --- a/mycobot_320/mycobot_320_moveit/scripts/sync_plan.py +++ b/mycobot_320/mycobot_320_moveit/scripts/sync_plan.py @@ -9,7 +9,7 @@ from packaging import version # min low version require -MAX_REQUIRE_VERSION = '3.6.0' +MAX_REQUIRE_VERSION = '3.5.3' current_verison = pymycobot.__version__ print('current pymycobot library version: {}'.format(current_verison)) diff --git a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py index 04d3b0a0..11393da4 100644 --- a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py +++ b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_color.py @@ -6,8 +6,18 @@ import os,sys import rospy from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot from moving_utils import Movement +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py index 7f95c4cc..32e48a9a 100644 --- a/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py +++ b/mycobot_ai/ai_mecharm_270/scripts/advance_detect_obj_img_folder.py @@ -8,7 +8,17 @@ import rospy from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' __version__ = "1.0" # Adaptive seeed diff --git a/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_color.py b/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_color.py index 92d39afc..28c1e3e9 100644 --- a/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_color.py +++ b/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_color.py @@ -9,8 +9,18 @@ import os,sys import rospy from visualization_msgs.msg import Marker -from pymycobot.mycobot import MyCobot from moving_utils import Movement +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_img_folder_opt.py b/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_img_folder_opt.py index 5d891ddc..73ef467b 100755 --- a/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_img_folder_opt.py +++ b/mycobot_ai/ai_mecharm_270/scripts/combine_detect_obj_img_folder_opt.py @@ -20,7 +20,17 @@ import tkFileDialog as filedialog import Tkinter as tk from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' __version__ = "1.0" # Adaptive seeed diff --git a/mycobot_ai/aikit_280_pi/scripts/aikit_color.py b/mycobot_ai/aikit_280_pi/scripts/aikit_color.py index 347f871f..f03cd065 100644 --- a/mycobot_ai/aikit_280_pi/scripts/aikit_color.py +++ b/mycobot_ai/aikit_280_pi/scripts/aikit_color.py @@ -6,7 +6,17 @@ import rospy from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_ai/aikit_280_pi/scripts/aikit_encode.py b/mycobot_ai/aikit_280_pi/scripts/aikit_encode.py index 0b64b045..6c957ac5 100644 --- a/mycobot_ai/aikit_280_pi/scripts/aikit_encode.py +++ b/mycobot_ai/aikit_280_pi/scripts/aikit_encode.py @@ -1,13 +1,23 @@ #encoding: UTF-8 import cv2 import numpy as np -from pymycobot.mycobot import MyCobot import time import os import rospy from visualization_msgs.msg import Marker from moving_utils import Movement import RPi.GPIO as GPIO +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot # y轴偏移量 pump_y = -55 diff --git a/mycobot_ai/aikit_280_pi/scripts/aikit_img.py b/mycobot_ai/aikit_280_pi/scripts/aikit_img.py index d32491f5..c44c1029 100644 --- a/mycobot_ai/aikit_280_pi/scripts/aikit_img.py +++ b/mycobot_ai/aikit_280_pi/scripts/aikit_img.py @@ -7,7 +7,17 @@ from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' __version__ = "1.0" # Adaptive seeed diff --git a/mycobot_ai/aikit_280_pi/scripts/aikit_shape.py b/mycobot_ai/aikit_280_pi/scripts/aikit_shape.py index 55d9a761..3f871111 100644 --- a/mycobot_ai/aikit_280_pi/scripts/aikit_shape.py +++ b/mycobot_ai/aikit_280_pi/scripts/aikit_shape.py @@ -6,7 +6,17 @@ import rospy from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_color.py b/mycobot_ai/aikit_320_pi/scripts/aikit_color.py index 05ef9bfb..219bc73f 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_color.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_color.py @@ -6,7 +6,17 @@ import rospy from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_encode.py b/mycobot_ai/aikit_320_pi/scripts/aikit_encode.py index 65be08da..12fb8d97 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_encode.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_encode.py @@ -1,12 +1,22 @@ #encoding: UTF-8 import cv2 import numpy as np -from pymycobot.mycobot import MyCobot import time import os import rospy from visualization_msgs.msg import Marker from moving_utils import Movement +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot # y轴偏移量 pump_y = -55 diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_color.py b/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_color.py index 4c18b875..87e3abc6 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_color.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_color.py @@ -6,7 +6,17 @@ import rospy from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_encode.py b/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_encode.py index ad86510b..6397fcdf 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_encode.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_gripper_encode.py @@ -2,12 +2,22 @@ import platform import cv2 import numpy as np -from pymycobot.mycobot import MyCobot import time import os import rospy from visualization_msgs.msg import Marker from moving_utils import Movement +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot # y轴偏移量 pump_y = -55 diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_img.py b/mycobot_ai/aikit_320_pi/scripts/aikit_img.py index 8c844ac4..5e22012f 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_img.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_img.py @@ -7,7 +7,17 @@ from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' __version__ = "1.0" # Adaptive seeed diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_object.py b/mycobot_ai/aikit_320_pi/scripts/aikit_object.py index 05a333a0..9223b0e9 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_object.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_object.py @@ -7,7 +7,17 @@ from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' __version__ = "1.0" # Adaptive seeed diff --git a/mycobot_ai/aikit_320_pi/scripts/aikit_shape.py b/mycobot_ai/aikit_320_pi/scripts/aikit_shape.py index 48e2cb05..2fade32f 100644 --- a/mycobot_ai/aikit_320_pi/scripts/aikit_shape.py +++ b/mycobot_ai/aikit_320_pi/scripts/aikit_shape.py @@ -6,7 +6,17 @@ import rospy from visualization_msgs.msg import Marker from moving_utils import Movement -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot IS_CV_4 = cv2.__version__[0] == '4' diff --git a/mycobot_communication/scripts/mycobot_services.py b/mycobot_communication/scripts/mycobot_services.py index 30026241..54681598 100755 --- a/mycobot_communication/scripts/mycobot_services.py +++ b/mycobot_communication/scripts/mycobot_services.py @@ -6,7 +6,17 @@ import fcntl from mycobot_communication.srv import * -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot mc = None diff --git a/mycobot_communication/scripts/mycobot_topics.py b/mycobot_communication/scripts/mycobot_topics.py index 5f01adb8..3214cb90 100755 --- a/mycobot_communication/scripts/mycobot_topics.py +++ b/mycobot_communication/scripts/mycobot_topics.py @@ -20,7 +20,17 @@ MycobotSetToolReference, ) from std_msgs.msg import UInt8 -from pymycobot.mycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot class Watcher: diff --git a/mycobot_communication/scripts/mycobot_topics_jsnn.py b/mycobot_communication/scripts/mycobot_topics_jsnn.py index 62b09a88..a5cbdb4f 100755 --- a/mycobot_communication/scripts/mycobot_topics_jsnn.py +++ b/mycobot_communication/scripts/mycobot_topics_jsnn.py @@ -17,10 +17,19 @@ MycobotPumpStatus, ) - -# from pymycobot import MyCobot - -from pymycobot import MyCobotSocket # pi +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + # from pymycobot import MyCobot + + from pymycobot import MyCobotSocket # pi class Watcher: diff --git a/mycobot_communication/scripts/mycobot_topics_pi.py b/mycobot_communication/scripts/mycobot_topics_pi.py index 2c0bcb40..ae4994a8 100755 --- a/mycobot_communication/scripts/mycobot_topics_pi.py +++ b/mycobot_communication/scripts/mycobot_topics_pi.py @@ -17,9 +17,18 @@ MycobotPumpStatus, ) - -from pymycobot import MyCobot -# from pymycobot import MyCobotSocket +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot + # from pymycobot import MyCobotSocket class Watcher: diff --git a/mycobot_communication/scripts/mycobot_topics_seeed.py b/mycobot_communication/scripts/mycobot_topics_seeed.py index d1e8154d..a20c11f8 100755 --- a/mycobot_communication/scripts/mycobot_topics_seeed.py +++ b/mycobot_communication/scripts/mycobot_topics_seeed.py @@ -18,7 +18,17 @@ ) -from pymycobot import MyCobot +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mycobot import MyCobot class Watcher: diff --git a/mypalletizer_260/mypalletizer_260/scripts/follow_display.py b/mypalletizer_260/mypalletizer_260/scripts/follow_display.py index ad54a1b0..9ebe5ad4 100755 --- a/mypalletizer_260/mypalletizer_260/scripts/follow_display.py +++ b/mypalletizer_260/mypalletizer_260/scripts/follow_display.py @@ -8,7 +8,17 @@ from visualization_msgs.msg import Marker -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer def talker(): diff --git a/mypalletizer_260/mypalletizer_260/scripts/slider_control.py b/mypalletizer_260/mypalletizer_260/scripts/slider_control.py index 8897c530..6043668c 100755 --- a/mypalletizer_260/mypalletizer_260/scripts/slider_control.py +++ b/mypalletizer_260/mypalletizer_260/scripts/slider_control.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # -*- coding:utf-8 -*- """[summary] @@ -14,7 +14,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer mc = None diff --git a/mypalletizer_260/mypalletizer_260_moveit/scripts/sync_plan.py b/mypalletizer_260/mypalletizer_260_moveit/scripts/sync_plan.py index 6f0db424..e9a3fe95 100644 --- a/mypalletizer_260/mypalletizer_260_moveit/scripts/sync_plan.py +++ b/mypalletizer_260/mypalletizer_260_moveit/scripts/sync_plan.py @@ -4,8 +4,17 @@ import rospy from sensor_msgs.msg import JointState -# from pymycobot.mycobot import MyCobot -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer mc = None diff --git a/mypalletizer_260/mypalletizer_260_pi/scripts/follow_display.py b/mypalletizer_260/mypalletizer_260_pi/scripts/follow_display.py index 4fe87416..b8ed1212 100644 --- a/mypalletizer_260/mypalletizer_260_pi/scripts/follow_display.py +++ b/mypalletizer_260/mypalletizer_260_pi/scripts/follow_display.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # -*- coding: utf-8 -*- import time @@ -8,7 +8,17 @@ from visualization_msgs.msg import Marker -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer def talker(): diff --git a/mypalletizer_260/mypalletizer_260_pi/scripts/slider_control.py b/mypalletizer_260/mypalletizer_260_pi/scripts/slider_control.py index 59f607e2..9c91753f 100644 --- a/mypalletizer_260/mypalletizer_260_pi/scripts/slider_control.py +++ b/mypalletizer_260/mypalletizer_260_pi/scripts/slider_control.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # -*- coding: utf-8 -*- """[summary] @@ -14,7 +14,17 @@ import rospy from sensor_msgs.msg import JointState -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer mc = None diff --git a/mypalletizer_260/mypalletizer_260_pi_moveit/scripts/sync_plan.py b/mypalletizer_260/mypalletizer_260_pi_moveit/scripts/sync_plan.py index e981a5b3..38928028 100644 --- a/mypalletizer_260/mypalletizer_260_pi_moveit/scripts/sync_plan.py +++ b/mypalletizer_260/mypalletizer_260_pi_moveit/scripts/sync_plan.py @@ -5,8 +5,17 @@ import rospy from sensor_msgs.msg import JointState -# from pymycobot.mycobot import MyCobot -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer mc = None diff --git a/mypalletizer_260/mypalletizer_communication/scripts/mypal_services.py b/mypalletizer_260/mypalletizer_communication/scripts/mypal_services.py index 005ecfcf..d8c460f7 100755 --- a/mypalletizer_260/mypalletizer_communication/scripts/mypal_services.py +++ b/mypalletizer_260/mypalletizer_communication/scripts/mypal_services.py @@ -5,8 +5,17 @@ # from mycobot_communication.srv import * from mypalletizer_communication.srv import * -# from pymycobot.mycobot import MyCobot -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer mc = None diff --git a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics.py b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics.py index 06557781..3ef00437 100755 --- a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics.py +++ b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics.py @@ -6,7 +6,6 @@ import signal import threading import rospy -from pymycobot.mypalletizer import MyPalletizer from mypalletizer_communication.msg import( MypalAngles, MypalCoords, @@ -15,7 +14,17 @@ MypalGripperStatus, MypalPumpStatus, ) - +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer class Watcher: """this class solves two problems with multithreaded diff --git a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py index b0f2ea9d..04f04496 100755 --- a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py +++ b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py @@ -6,7 +6,6 @@ import signal import threading import rospy -from pymycobot.mypalletizer import MyPalletizer from mypalletizer_communication.msg import( MypalAngles, MypalCoords, @@ -15,6 +14,17 @@ MypalGripperStatus, MypalPumpStatus, ) +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer class Watcher: diff --git a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_seeed.py b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_seeed.py index 24adab95..d2f4b669 100644 --- a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_seeed.py +++ b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_seeed.py @@ -16,7 +16,17 @@ MypalGripperStatus, MypalPumpStatus, ) -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer class Watcher: diff --git a/mypalletizer_260/mypalletizer_communication/scripts/test.py b/mypalletizer_260/mypalletizer_communication/scripts/test.py index e9cb605a..05e9a74a 100644 --- a/mypalletizer_260/mypalletizer_communication/scripts/test.py +++ b/mypalletizer_260/mypalletizer_communication/scripts/test.py @@ -1,4 +1,14 @@ -from pymycobot.mypalletizer import MyPalletizer +import pymycobot +from packaging import version +# min low version require +MAX_REQUIRE_VERSION = '3.5.3' +current_verison = pymycobot.__version__ +print('current pymycobot library version: {}'.format(current_verison)) +if version.parse(current_verison) > version.parse(MAX_REQUIRE_VERSION): + 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)) +else: + print('pymycobot library version meets the requirements!') + from pymycobot.mypalletizer import MyPalletizer mp = MyPalletizer("/dev/ttyUSB0", 115200) n = mp.get_angles() # while(1):