refacotr: update ros package for Atom2.4 or later.

This commit is contained in:
zhangLijun 2021-01-28 16:30:40 +08:00
parent 1f71328852
commit bc1c1d79bf
5 changed files with 14 additions and 10 deletions

View file

@ -10,10 +10,12 @@
<!-- This is the mycobot ROS package designed by Zhang Lijun([lijun.zhang@elephantrobotics.com]()) --> <!-- This is the mycobot ROS package designed by Zhang Lijun([lijun.zhang@elephantrobotics.com]()) -->
> 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)<br> > 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)<br>
> ubuntu: 16.04LTS<br> > ubuntu: 16.04LTS<br>
> ros version: 1.12.17 > 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) Download ROS [http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/ROS/Installation)
## 1. Installation ## 1. Installation
@ -25,7 +27,7 @@ For using this package, the [Python api](https://github.com/elephantrobotics/pym
If you want to use api alone, you can look here [https://github.com/elephantrobotics/pymycobot.git](https://github.com/elephantrobotics/pymycobot.git) If you want to use api alone, you can look here [https://github.com/elephantrobotics/pymycobot.git](https://github.com/elephantrobotics/pymycobot.git)
```bash ```bash
pip install pymycobot==1.0.7 pip install pymycobot --user
``` ```
### 1.2 Package Download and Install ### 1.2 Package Download and Install

View file

@ -10,9 +10,11 @@
<!-- This is the mycobot ROS package designed by Zhang Lijun([lijun.zhang@elephantrobotics.com]()) --> <!-- This is the mycobot ROS package designed by Zhang Lijun([lijun.zhang@elephantrobotics.com]()) -->
> 请确保顶部的 Atom 烧入 `Atom2.1alpha`,底部的 Basic 烧入 `Transponder`。烧录工具的下载地址: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)<br> > 请确保顶部的 Atom 烧入 `Atom`,底部的 Basic 烧入 `Transponder`。烧录工具的下载地址: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)<br>
> 该包的测试环境:<br> &nbsp;&nbsp;&nbsp;&nbsp; ubuntu: 16.04LTS<br> &nbsp;&nbsp;&nbsp;&nbsp; ros version: 1.12.17 > 该包的测试环境:<br> &nbsp;&nbsp;&nbsp;&nbsp; ubuntu: 16.04LTS<br> &nbsp;&nbsp;&nbsp;&nbsp; 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)**
ROS 下载地址:[http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/ROS/Installation) ROS 下载地址:[http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/ROS/Installation)
## 1. 安装 ## 1. 安装
@ -24,7 +26,7 @@ ROS 下载地址:[http://wiki.ros.org/ROS/Installation](http://wiki.ros.org/RO
如果你仅仅想单独使用 api, 你可以去到这里 [https://github.com/elephantrobotics/pymycobot.git](https://github.com/elephantrobotics/pymycobot.git) 如果你仅仅想单独使用 api, 你可以去到这里 [https://github.com/elephantrobotics/pymycobot.git](https://github.com/elephantrobotics/pymycobot.git)
```bash ```bash
pip install pymycobot==1.0.7 pip install pymycobot --user
``` ```
### 1.2 Ros 包的下载和安装 ### 1.2 Ros 包的下载和安装

View file

@ -209,7 +209,7 @@ def listener():
while not rospy.is_shutdown(): while not rospy.is_shutdown():
joint_state_send.header.stamp = rospy.Time.now() joint_state_send.header.stamp = rospy.Time.now()
angles = mycobot.get_angles_of_radian() angles = mycobot.get_radians()
rospy.loginfo(angles) rospy.loginfo(angles)
if angles: if angles:
data_list = [] data_list = []
@ -228,6 +228,6 @@ def listener():
if __name__ == '__main__': if __name__ == '__main__':
port = subprocess.check_output(['echo -n /dev/ttyUSB*'], port = subprocess.check_output(['echo -n /dev/ttyUSB*'],
shell=True) shell=True).decode()
mycobot = MyCobot(port) mycobot = MyCobot(port)
listener() listener()

View file

@ -17,7 +17,7 @@ def callback(data):
value *= -1 value *= -1
data_list.append(value) data_list.append(value)
mc.send_angles_by_radian(data_list, 80) mc.send_radians(data_list, 80)
# time.sleep(0.5) # time.sleep(0.5)
def listener(): def listener():
@ -30,6 +30,6 @@ def listener():
if __name__ == '__main__': if __name__ == '__main__':
port = subprocess.check_output(['echo -n /dev/ttyUSB*'], port = subprocess.check_output(['echo -n /dev/ttyUSB*'],
shell=True) shell=True).decode()
mc = MyCobot(port) mc = MyCobot(port)
listener() listener()

View file

@ -38,7 +38,7 @@ def talker():
while not rospy.is_shutdown(): while not rospy.is_shutdown():
joint_state_send.header.stamp = rospy.Time.now() joint_state_send.header.stamp = rospy.Time.now()
angles = mycobot.get_angles_of_radian() angles = mycobot.get_radians()
data_list = [] data_list = []
for index, value in enumerate(angles): for index, value in enumerate(angles):
if index != 2: if index != 2:
@ -78,7 +78,7 @@ def talker():
if __name__ == '__main__': if __name__ == '__main__':
port = subprocess.check_output(['echo -n /dev/ttyUSB*'], port = subprocess.check_output(['echo -n /dev/ttyUSB*'],
shell=True) shell=True).decode()
mycobot = MyCobot(port) mycobot = MyCobot(port)
try: try:
talker() talker()