From 6d20af37190ded2c094cdd3fe61a0f26829850be Mon Sep 17 00:00:00 2001 From: zhangLijun Date: Thu, 28 Jan 2021 16:30:40 +0800 Subject: [PATCH] refacotr: update ros package for `Atom2.4` or later. --- README.md | 8 ++++---- READMEcn.md | 8 ++++---- scripts/control_marker.py | 4 ++-- scripts/control_slider.py | 4 ++-- scripts/display.py | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6d5dc37..408970b 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,12 @@ -> Make sure that `Atom2.1alpha` is flashed into the top Atom and `Transponder` is flashed into the base Basic .The tool download address: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)
+> Make sure that `Atom` is flashed into the top Atom and `Transponder` is flashed into the base Basic .The tool download address: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)
> ubuntu: 16.04LTS
> ros version: 1.12.17 +**If your `Atom` is 2.3 or before, or `pymycobot` is 1.\*, Please check branch [before](https://github.com/elephantrobotics/myCobotRos/tree/before)** + Download ROS [http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/ROS/Installation) ## 1. Installation @@ -22,10 +24,8 @@ Download ROS [http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/ROS/Inst For using this package, the [Python api](https://github.com/elephantrobotics/pymycobot.git) library should be installed first. -If you want to use api alone, you can look here [https://github.com/elephantrobotics/pymycobot.git](https://github.com/elephantrobotics/pymycobot.git) - ```bash -pip install pymycobot==1.0.7 +pip install pymycobot --user ``` ### 1.2 Package Download and Install diff --git a/READMEcn.md b/READMEcn.md index 60715c1..bee04aa 100644 --- a/READMEcn.md +++ b/READMEcn.md @@ -10,9 +10,11 @@ -> 请确保顶部的 Atom 烧入 `Atom2.1alpha`,底部的 Basic 烧入 `Transponder`。烧录工具的下载地址: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)
+> 请确保顶部的 Atom 烧入 `Atom`,底部的 Basic 烧入 `Transponder`。烧录工具的下载地址: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)
> 该包的测试环境:
     ubuntu: 16.04LTS
     ros version: 1.12.17 +**如果你的`Atom` 是 2.3 或更早的, 或者 `pymycobot` 是 1.\*, 请查看分支 [before](https://github.com/elephantrobotics/myCobotRos/tree/before)** + ROS 下载地址:[http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/ROS/Installation) ## 1. 安装 @@ -21,10 +23,8 @@ ROS 下载地址:[http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/RO 要使用该包,请确保 [python api](https://github.com/elephantrobotics/pymycobot.git) 已正确安装。 -如果你仅仅想单独使用 api, 你可以去到这里 [https://github.com/elephantrobotics/pymycobot.git](https://github.com/elephantrobotics/pymycobot.git) - ```bash -pip install pymycobot==1.0.7 +pip install pymycobot --user ``` ### 1.2 Ros 包的下载和安装 diff --git a/scripts/control_marker.py b/scripts/control_marker.py index 1aede84..c5458bf 100755 --- a/scripts/control_marker.py +++ b/scripts/control_marker.py @@ -209,7 +209,7 @@ def listener(): while not rospy.is_shutdown(): joint_state_send.header.stamp = rospy.Time.now() - angles = mycobot.get_angles_of_radian() + angles = mycobot.get_radians() rospy.loginfo(angles) if angles: data_list = [] @@ -228,6 +228,6 @@ def listener(): if __name__ == '__main__': port = subprocess.check_output(['echo -n /dev/ttyUSB*'], - shell=True) + shell=True).decode() mycobot = MyCobot(port) listener() diff --git a/scripts/control_slider.py b/scripts/control_slider.py index d9b4bfa..1b41379 100755 --- a/scripts/control_slider.py +++ b/scripts/control_slider.py @@ -17,7 +17,7 @@ def callback(data): value *= -1 data_list.append(value) - mc.send_angles_by_radian(data_list, 80) + mc.send_radians(data_list, 80) # time.sleep(0.5) def listener(): @@ -30,6 +30,6 @@ def listener(): if __name__ == '__main__': port = subprocess.check_output(['echo -n /dev/ttyUSB*'], - shell=True) + shell=True).decode() mc = MyCobot(port) listener() diff --git a/scripts/display.py b/scripts/display.py index 634f4d4..0743c95 100755 --- a/scripts/display.py +++ b/scripts/display.py @@ -38,7 +38,7 @@ def talker(): while not rospy.is_shutdown(): joint_state_send.header.stamp = rospy.Time.now() - angles = mycobot.get_angles_of_radian() + angles = mycobot.get_radians() data_list = [] for index, value in enumerate(angles): if index != 2: @@ -78,7 +78,7 @@ def talker(): if __name__ == '__main__': port = subprocess.check_output(['echo -n /dev/ttyUSB*'], - shell=True) + shell=True).decode() mycobot = MyCobot(port) try: talker()