mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
refacotr: update ros package for Atom2.4 or later.
This commit is contained in:
parent
1f71328852
commit
bc1c1d79bf
5 changed files with 14 additions and 10 deletions
|
|
@ -10,10 +10,12 @@
|
|||
|
||||
<!-- 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>
|
||||
> 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
|
||||
|
|
@ -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)
|
||||
|
||||
```bash
|
||||
pip install pymycobot==1.0.7
|
||||
pip install pymycobot --user
|
||||
```
|
||||
|
||||
### 1.2 Package Download and Install
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@
|
|||
|
||||
<!-- 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> ubuntu: 16.04LTS<br> 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)
|
||||
|
||||
## 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)
|
||||
|
||||
```bash
|
||||
pip install pymycobot==1.0.7
|
||||
pip install pymycobot --user
|
||||
```
|
||||
|
||||
### 1.2 Ros 包的下载和安装
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue