pymycobot 3.5.0.dev7__tar.gz → 3.5.0.dev9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. pymycobot-3.5.0.dev9/PKG-INFO +1459 -0
  2. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/README.md +35 -3
  3. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/__init__.py +34 -8
  4. pymycobot-3.5.0.dev9/pymycobot/close_loop.py +819 -0
  5. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/common.py +382 -89
  6. pymycobot-3.5.0.dev9/pymycobot/conveyor_api.py +212 -0
  7. pymycobot-3.5.0.dev7/pymycobot/myarm.py → pymycobot-3.5.0.dev9/pymycobot/dualcobotx.py +130 -174
  8. pymycobot-3.5.0.dev9/pymycobot/elephantrobot.py +761 -0
  9. pymycobot-3.5.0.dev9/pymycobot/error.py +1388 -0
  10. pymycobot-3.5.0.dev9/pymycobot/generate.py +646 -0
  11. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/log.py +4 -1
  12. pymycobot-3.5.0.dev9/pymycobot/mecharm270.py +756 -0
  13. pymycobot-3.5.0.dev9/pymycobot/mecharmsocket.py +769 -0
  14. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mercury.py +18 -3
  15. pymycobot-3.5.0.dev9/pymycobot/mercury_api.py +2607 -0
  16. pymycobot-3.5.0.dev9/pymycobot/mercury_arms_socket.py +86 -0
  17. pymycobot-3.5.0.dev9/pymycobot/mercury_ros_api.py +524 -0
  18. pymycobot-3.5.0.dev9/pymycobot/mercurychassis_api.py +368 -0
  19. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mercurysocket.py +3 -1
  20. pymycobot-3.5.0.dev9/pymycobot/myagv.py +428 -0
  21. pymycobot-3.5.0.dev9/pymycobot/myarm.py +797 -0
  22. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/myarm_api.py +55 -80
  23. pymycobot-3.5.0.dev9/pymycobot/myarmc.py +31 -0
  24. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/myarmm.py +53 -5
  25. pymycobot-3.5.0.dev9/pymycobot/myarmm_control.py +913 -0
  26. pymycobot-3.5.0.dev9/pymycobot/myarmsocket.py +753 -0
  27. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mybuddy.py +6 -4
  28. pymycobot-3.5.0.dev9/pymycobot/mybuddybluetooth.py +137 -0
  29. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mybuddyemoticon.py +3 -3
  30. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mybuddysocket.py +18 -3
  31. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mycobot.py +103 -81
  32. pymycobot-3.5.0.dev9/pymycobot/mycobot280.py +839 -0
  33. pymycobot-3.5.0.dev9/pymycobot/mycobot280socket.py +868 -0
  34. pymycobot-3.5.0.dev9/pymycobot/mycobot280x5pi.py +898 -0
  35. pymycobot-3.5.0.dev9/pymycobot/mycobot320.py +1288 -0
  36. pymycobot-3.5.0.dev9/pymycobot/mycobot320socket.py +1314 -0
  37. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mycobotpro630.py +458 -183
  38. pymycobot-3.5.0.dev7/pymycobot/mecharmsocket.py → pymycobot-3.5.0.dev9/pymycobot/mycobotsocket.py +39 -17
  39. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mypalletizer.py +4 -2
  40. pymycobot-3.5.0.dev9/pymycobot/mypalletizer260.py +640 -0
  41. pymycobot-3.5.0.dev9/pymycobot/mypalletizersocket.py +606 -0
  42. pymycobot-3.5.0.dev9/pymycobot/pro400.py +341 -0
  43. pymycobot-3.5.0.dev9/pymycobot/pro400client.py +312 -0
  44. pymycobot-3.5.0.dev9/pymycobot/pro630.py +354 -0
  45. pymycobot-3.5.0.dev9/pymycobot/pro630client.py +306 -0
  46. pymycobot-3.5.0.dev9/pymycobot/protocol_packet_handler.py +295 -0
  47. pymycobot-3.5.0.dev9/pymycobot/robot_info.py +389 -0
  48. pymycobot-3.5.0.dev9/pymycobot/sms.py +236 -0
  49. pymycobot-3.5.0.dev9/pymycobot/tool_coords.py +92 -0
  50. pymycobot-3.5.0.dev9/pymycobot/ultraArm.py +742 -0
  51. pymycobot-3.5.0.dev9/pymycobot.egg-info/PKG-INFO +1459 -0
  52. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot.egg-info/SOURCES.txt +28 -0
  53. pymycobot-3.5.0.dev9/pymycobot.egg-info/requires.txt +5 -0
  54. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot.egg-info/top_level.txt +1 -0
  55. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/requirements.txt +2 -0
  56. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/setup.py +1 -1
  57. pymycobot-3.5.0.dev9/tests/__init__.py +0 -0
  58. pymycobot-3.5.0.dev9/tests/conftest.py +0 -0
  59. pymycobot-3.5.0.dev9/tests/rasp_myArm_test_gui.py +468 -0
  60. pymycobot-3.5.0.dev9/tests/rasp_mycobot_test_gui.py +463 -0
  61. pymycobot-3.5.0.dev9/tests/rasp_mypall_test_gui.py +482 -0
  62. pymycobot-3.5.0.dev9/tests/special_angles.py +42 -0
  63. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/tests/test_api.py +1 -1
  64. pymycobot-3.5.0.dev7/PKG-INFO +0 -2887
  65. pymycobot-3.5.0.dev7/pymycobot/elephantrobot.py +0 -402
  66. pymycobot-3.5.0.dev7/pymycobot/error.py +0 -491
  67. pymycobot-3.5.0.dev7/pymycobot/generate.py +0 -1192
  68. pymycobot-3.5.0.dev7/pymycobot/mercury_api.py +0 -1654
  69. pymycobot-3.5.0.dev7/pymycobot/myagv.py +0 -362
  70. pymycobot-3.5.0.dev7/pymycobot/myarmc.py +0 -11
  71. pymycobot-3.5.0.dev7/pymycobot/myarmsocket.py +0 -243
  72. pymycobot-3.5.0.dev7/pymycobot/mybuddybluetooth.py +0 -133
  73. pymycobot-3.5.0.dev7/pymycobot/mycobotsocket.py +0 -243
  74. pymycobot-3.5.0.dev7/pymycobot/mypalletizersocket.py +0 -236
  75. pymycobot-3.5.0.dev7/pymycobot/ultraArm.py +0 -652
  76. pymycobot-3.5.0.dev7/pymycobot.egg-info/PKG-INFO +0 -2887
  77. pymycobot-3.5.0.dev7/pymycobot.egg-info/requires.txt +0 -2
  78. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/LICENSE +0 -0
  79. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/MANIFEST.in +0 -0
  80. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/Interface.py +0 -0
  81. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/bluet.py +0 -0
  82. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/genre.py +0 -0
  83. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mecharm.py +0 -0
  84. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/mercurychassis.py +0 -0
  85. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/progripper.py +0 -0
  86. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/public.py +0 -0
  87. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot/utils.py +0 -0
  88. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/pymycobot.egg-info/dependency_links.txt +0 -0
  89. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/setup.cfg +0 -0
  90. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/tests/test_generator.py +0 -0
  91. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/tests/test_socket.py +0 -0
  92. {pymycobot-3.5.0.dev7 → pymycobot-3.5.0.dev9}/tests/test_utils.py +0 -0
@@ -0,0 +1,1459 @@
1
+ Metadata-Version: 2.1
2
+ Name: pymycobot
3
+ Version: 3.5.0.dev9
4
+ Summary: Python API for serial communication of MyCobot.
5
+ Home-page: https://github.com/elephantrobotics/pymycobot
6
+ Author: Elephantrobotics
7
+ Author-email: weiquan.xu@elephantrobotics.com
8
+ Classifier: Programming Language :: Python :: 2.7
9
+ Classifier: Programming Language :: Python :: 3.5
10
+ Classifier: Programming Language :: Python :: 3.6
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+
21
+ # This is Python API for ElephantRobotics product
22
+
23
+ ![Python 2.7](https://img.shields.io/badge/Python-v2.7%5E-green?logo=python)
24
+ ![Python 3](https://img.shields.io/badge/Python-v3%5E-green?logo=python)
25
+ [![pypi_version](https://img.shields.io/pypi/v/pymycobot?label=pypi)](https://pypi.org/project/pigit)
26
+
27
+ This is a python API for serial communication with mycobot and controlling it.
28
+
29
+ [![home](./f3-min2.jpg)](https://www.elephantrobotics.com/en/myCobot-en/)
30
+
31
+ ## Installation
32
+
33
+ **Notes**:
34
+
35
+ > Make sure that `Atom` is flashed into the top Atom, `Transponder` is flashed into the base Basic. <br>
36
+ > The firmware `Atom` and `Transponder` download address: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)<br>
37
+ > You also can use myStudio to flash them, myStudio address: [https://github.com/elephantrobotics/myStudio/releases](https://github.com/elephantrobotics/myStudio/releases)
38
+
39
+ ### Pip
40
+
41
+ ```bash
42
+ pip install pymycobot --upgrade
43
+ ```
44
+
45
+ <!--
46
+ **Notes:**
47
+
48
+ > Now only the version is `Atom2.4` or later is supported. If you use an earlier version, please install `pymycobot 1.0.7`.
49
+
50
+ ```bash
51
+ pip install pymycobot==1.0.7 --user
52
+ ```
53
+ -->
54
+
55
+ ### Source code
56
+
57
+ ```bash
58
+ git clone https://github.com/elephantrobotics/pymycobot.git <your-path>
59
+ cd <your-path>/pymycobot
60
+ # Install
61
+ [sudo] python2 setup.py install
62
+ # or
63
+ [sudo] python3 setup.py install
64
+ ```
65
+
66
+ Or the more modern form:
67
+
68
+ ```bash
69
+ # Install
70
+ pip install .
71
+ # Uninstall
72
+ pip uninstall .
73
+ ```
74
+
75
+ ## Usage:
76
+
77
+ ```python
78
+ # for mycobot 280 machine
79
+ from pymycobot import MyCobot280
80
+ from pymycobot import MyCobot280Socket
81
+ # for mycobot 320 machine
82
+ from pymycobot import MyCobot320
83
+ from pymycobot import MyCobot320Socket
84
+ # for mecharm 270 machine
85
+ from pymycobot import MechArm270
86
+ from pymycobot import MechArmSocket
87
+ # for mypalletizer 260 machine
88
+ from pymycobot import MyPalletizer260
89
+ from pymycobot import MyPalletizerSocket
90
+ ```
91
+
92
+ The [`demo`](./demo) directory stores some test case files.
93
+
94
+ You can find out which interfaces pymycobot provides in `pymycobot/README.md`.
95
+
96
+ Please go to [here](./docs/README.md).
97
+
98
+
99
+ > Note: Version v3.6.0 differentiates interfaces by model. Starting from this version, the MyCobot class will no longer be maintained. For new usage, please refer to the document:
100
+
101
+ ![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/chinese.svg) ![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/english.svg)
102
+
103
+ [MyCobot 280 API说明](./docs/MyCobot_280_zh.md) | [MyCobot 280 API Description](./docs/MyCobot_280_en.md)
104
+
105
+ [MyCobot 320 API说明](./docs/MyCobot_320_zh.md) | [MyCobot 320 API Description](./docs/MyCobot_320_en.md)
106
+
107
+ [MechArm 270 API说明](./docs/MechArm_270_zh.md) | [MechArm 270 API Description](./docs/MechArm_270_en.md)
108
+
109
+ [MyPalletizer 260 API说明](./docs/MyPalletizer_260_zh.md) | [MyPalletizer 260 API Description](./docs/MyPalletizer_260_en.md)
110
+
111
+ [myAGV API说明](./docs/myAGV_zh.md) | [myAGV API Description](./docs/myAGV_en.md)
112
+
113
+ [myArm_M&C API说明](./docs/myArm_M&C_zh.md) | [myArm_M&C API Description](./docs/myArm_M&C_en.md)
114
+
115
+ [ultraArm P340 API说明](./docs/ultraArm_P340_zh.md) | [ultraArm P340 API Description](./docs/ultraArm_P340_en.md)# pymycobot
116
+
117
+ **This is python API for ElephantRobotics product**
118
+
119
+ We support Python2, Python3.5 or later.
120
+
121
+ ![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/chinese.svg) ![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/english.svg)
122
+
123
+ [MyCobot 280 API说明](./MyCobot_280_zh.md) | [MyCobot 280 API Description](./MyCobot_280_en.md)
124
+
125
+ [MyCobot 320 API说明](./MyCobot_320_zh.md) | [MyCobot 320 API Description](./MyCobot_320_en.md)
126
+
127
+ [MechArm 270 API说明](./MechArm_270_zh.md) | [MechArm 270 API Description](./MechArm_270_en.md)
128
+
129
+ [MyPalletizer 260 API说明](./MyPalletizer_260_zh.md) | [MyPalletizer 260 API Description](./MyPalletizer_260_en.md)
130
+
131
+ [myAGV API说明](./myAGV_zh.md) | [myAGV API Description](./myAGV_en.md)
132
+
133
+ [myArm_M&C API说明](./myArm_M&C_zh.md) | [myArm_M&C API Description](./myArm_M&C_en.md)
134
+
135
+ [ultraArm P340 API说明](./ultraArm_P340_zh.md) | [ultraArm P340 API Description](./ultraArm_P340_en.md)
136
+
137
+ <details>
138
+ <summary>Catalogue:</summary>
139
+
140
+ <!-- vim-markdown-toc GFM -->
141
+
142
+ - [pymycobot](#pymycobot)
143
+ - [MyBuddy](#mybuddy)
144
+ - [base\_to\_single\_coords(base\_coords, arm)](#base_to_single_coordsbase_coords-arm)
145
+ - [collision(left\_angles, right\_angles)](#collisionleft_angles-right_angles)
146
+ - [collision\_switch(state)](#collision_switchstate)
147
+ - [focus\_servo(id, servo\_id)](#focus_servoid-servo_id)
148
+ - [get\_acceleration(id)](#get_accelerationid)
149
+ - [get\_angle(id, joint\_id)](#get_angleid-joint_id)
150
+ - [get\_angles(id)](#get_anglesid)
151
+ - [get\_base\_coord(id)](#get_base_coordid)
152
+ - [get\_base\_coords(\*args: int)](#get_base_coordsargs-int)
153
+ - [get\_coord(id, joint\_id)](#get_coordid-joint_id)
154
+ - [get\_coords(id)](#get_coordsid)
155
+ - [get\_digital\_input(id, pin\_no)](#get_digital_inputid-pin_no)
156
+ - [get\_encoder(id, joint\_id)](#get_encoderid-joint_id)
157
+ - [get\_encoders(id)](#get_encodersid)
158
+ - [get\_end\_type(id)](#get_end_typeid)
159
+ - [get\_gripper\_value(id)](#get_gripper_valueid)
160
+ - [get\_joint\_current(id, joint\_id)](#get_joint_currentid-joint_id)
161
+ - [get\_joint\_max\_angle(id, joint\_id)](#get_joint_max_angleid-joint_id)
162
+ - [get\_joint\_min\_angle(id, joint\_id)](#get_joint_min_angleid-joint_id)
163
+ - [get\_movement\_type(id)](#get_movement_typeid)
164
+ - [get\_plan\_acceleration(id=0)](#get_plan_accelerationid0)
165
+ - [get\_plan\_speed(id=0)](#get_plan_speedid0)
166
+ - [get\_reference\_frame(id)](#get_reference_frameid)
167
+ - [get\_robot\_id(id)](#get_robot_idid)
168
+ - [get\_robot\_version(id)](#get_robot_versionid)
169
+ - [get\_servo\_currents(id)](#get_servo_currentsid)
170
+ - [get\_servo\_data(id, servo\_no, data\_id)](#get_servo_dataid-servo_no-data_id)
171
+ - [get\_servo\_status(id)](#get_servo_statusid)
172
+ - [get\_servo\_spees(id)](#get_servo_speesid)
173
+ - [get\_servo\_temps(id)](#get_servo_tempsid)
174
+ - [get\_servo\_voltages(id)](#get_servo_voltagesid)
175
+ - [get\_speed(id)](#get_speedid)
176
+ - [get\_system\_version(id)](#get_system_versionid)
177
+ - [get\_tool\_reference(id)](#get_tool_referenceid)
178
+ - [get\_world\_reference(id)](#get_world_referenceid)
179
+ - [is\_all\_servo\_enable(id)](#is_all_servo_enableid)
180
+ - [is\_collision\_on()](#is_collision_on)
181
+ - [is\_controller\_connected(id=0)](#is_controller_connectedid0)
182
+ - [is\_free\_mode(id)](#is_free_modeid)
183
+ - [is\_gripper\_moving(id)](#is_gripper_movingid)
184
+ - [is\_in\_position(id, data, mode)](#is_in_positionid-data-mode)
185
+ - [is\_moving(id)](#is_movingid)
186
+ - [is\_paused(id)](#is_pausedid)
187
+ - [is\_power\_on(id=0)](#is_power_onid0)
188
+ - [is\_servo\_enable(id, servo\_id)](#is_servo_enableid-servo_id)
189
+ - [jog\_absolute(id, joint\_id, angle, speed)](#jog_absoluteid-joint_id-angle-speed)
190
+ - [jog\_angle(id, joint\_id, direction, speed)](#jog_angleid-joint_id-direction-speed)
191
+ - [jog\_coord(id, coord\_id, direction, speed)](#jog_coordid-coord_id-direction-speed)
192
+ - [jog\_inc\_coord(axis, increment, speed)](#jog_inc_coordaxis-increment-speed)
193
+ - [jog\_increment(id, joint\_id, increment, speed)](#jog_incrementid-joint_id-increment-speed)
194
+ - [jog\_stop(id)](#jog_stopid)
195
+ - [joint\_brake(id, joint\_id)](#joint_brakeid-joint_id)
196
+ - [pause(id)](#pauseid)
197
+ - [power\_off(id=0)](#power_offid0)
198
+ - [power\_on(id=0)](#power_onid0)
199
+ - [read\_next\_error(id=0)](#read_next_errorid0)
200
+ - [release\_all\_servos(id=0)](#release_all_servosid0)
201
+ - [release\_servo(id, servo\_id)](#release_servoid-servo_id)
202
+ - [resume(id)](#resumeid)
203
+ - [send\_angle(id, joint, angle, speed)](#send_angleid-joint-angle-speed)
204
+ - [send\_angles(id, degrees, speed)](#send_anglesid-degrees-speed)
205
+ - [send\_coord(id, coord, data, speed)](#send_coordid-coord-data-speed)
206
+ - [send\_coords(id, coords, speed, mode)](#send_coordsid-coords-speed-mode)
207
+ - [set\_acceleration(id, acc)](#set_accelerationid-acc)
208
+ - [set\_color(id, r=0, g=0, b=0)](#set_colorid-r0-g0-b0)
209
+ - [set\_digital\_output(id, pin\_no, pin\_signal)](#set_digital_outputid-pin_no-pin_signal)
210
+ - [set\_encoder(id, joint\_id, encoder, speed)](#set_encoderid-joint_id-encoder-speed)
211
+ - [set\_encoders(id, encoders, speed)](#set_encodersid-encoders-speed)
212
+ - [set\_end\_type(id, end)](#set_end_typeid-end)
213
+ - [set\_encoders\_drag(id, encoders, speeds)](#set_encoders_dragid-encoders-speeds)
214
+ - [set\_free\_mode(id, value)](#set_free_modeid-value)
215
+ - [set\_fresh\_mode(id, mode)](#set_fresh_modeid-mode)
216
+ - [set\_gripper\_calibration(id)](#set_gripper_calibrationid)
217
+ - [set\_gripper\_state(id, flag)](#set_gripper_stateid-flag)
218
+ - [set\_gripper\_value(id, value, speed)](#set_gripper_valueid-value-speed)
219
+ - [set\_joint\_current(id, joint\_id, current)](#set_joint_currentid-joint_id-current)
220
+ - [set\_joint\_max(id, joint\_id, angle)](#set_joint_maxid-joint_id-angle)
221
+ - [set\_joint\_min(id, joint\_id, angle)](#set_joint_minid-joint_id-angle)
222
+ - [set\_movement\_type(id, move\_type)](#set_movement_typeid-move_type)
223
+ - [set\_pin\_mode(id, pin\_no, pin\_mode)](#set_pin_modeid-pin_no-pin_mode)
224
+ - [set\_plan\_acceleration(id, acceleration)](#set_plan_accelerationid-acceleration)
225
+ - [set\_plan\_speed(id, speed)](#set_plan_speedid-speed)
226
+ - [set\_pwm\_output()](#set_pwm_output)
227
+ - [set\_reference\_frame(id, rftype)](#set_reference_frameid-rftype)
228
+ - [set\_robot\_id(id, new\_id)](#set_robot_idid-new_id)
229
+ - [set\_servo\_calibration(id, servo\_no)](#set_servo_calibrationid-servo_no)
230
+ - [set\_servo\_data(id, servo\_no, data\_id, value)](#set_servo_dataid-servo_no-data_id-value)
231
+ - [set\_speed(id, speed)](#set_speedid-speed)
232
+ - [set\_tool\_reference(id, coords)](#set_tool_referenceid-coords)
233
+ - [set\_world\_reference(id, coords)](#set_world_referenceid-coords)
234
+ - [stop(id)](#stopid)
235
+ - [write\_base\_coord(id, axis, coord, speed)](#write_base_coordid-axis-coord-speed)
236
+ - [write\_base\_coords(id, coords, speed)](#write_base_coordsid-coords-speed)
237
+ - [get\_radians(id)](#get_radiansid)
238
+ - [send\_radians(id, radians, speed)](#send_radiansid-radians-speed)
239
+ - [set\_gpio\_input(pin)](#set_gpio_inputpin)
240
+ - [set\_gpio\_mode(pin\_no, mode)](#set_gpio_modepin_no-mode)
241
+ - [set\_gpio\_output(pin, v)](#set_gpio_outputpin-v)
242
+ - [set\_gpio\_pwm(pin, baud, dc)](#set_gpio_pwmpin-baud-dc)
243
+ - [MyBuddyEmoticon](#mybuddyemoticon)
244
+ - [MyBuddyEmoticon(file\_path: list = \[\], window\_size: tuple = \[\], loop=False)](#mybuddyemoticonfile_path-list---window_size-tuple---loopfalse)
245
+ - [add\_file\_path(path\_time: list)](#add_file_pathpath_time-list)
246
+ - [del\_file\_path(index: int)](#del_file_pathindex-int)
247
+ - [file\_path](#file_path)
248
+ - [join()](#join)
249
+ - [pause()](#pause)
250
+ - [run()](#run)
251
+ - [start()](#start)
252
+
253
+ <!-- vim-markdown-toc -->
254
+ </details>
255
+
256
+ # MyBuddy
257
+
258
+ ### base_to_single_coords(base_coords, arm)
259
+
260
+ Convert base coordinates to coordinates
261
+
262
+ * **Parameters**
263
+
264
+ * **coords** – a list of base coords value len 6
265
+
266
+ * **arm** – 0 - left. 1 - right
267
+
268
+ * **Returns**
269
+
270
+ coords
271
+
272
+ ### collision(left_angles, right_angles)
273
+
274
+ Collision detection main program
275
+
276
+ * **Parameters**
277
+
278
+ * **left_angles** – left arm angle len 6.
279
+
280
+ * **right_angles** – right arm angle len 6.
281
+
282
+ * **Returns**
283
+
284
+ int
285
+
286
+ ### collision_switch(state)
287
+
288
+ Collision Detection Switch
289
+
290
+ * **Parameters**
291
+
292
+ **state** (_int_) – 0 - close 1 - open (Off by default)
293
+
294
+ ### focus_servo(id, servo_id)
295
+
296
+ Power on designated servo
297
+
298
+ * **Parameters**
299
+
300
+ * **id** – 1/2/3 (L/R/W)
301
+
302
+ * **servo_id** – 1 - 6
303
+
304
+ ### get_acceleration(id)
305
+
306
+ Read acceleration during all moves
307
+
308
+ * **Parameters**
309
+
310
+ **id** – 1/2/3 (L/R/W)
311
+
312
+ ### get_angle(id, joint_id)
313
+
314
+ Get the angle of a single joint
315
+
316
+ * **Parameters**
317
+
318
+ * **id** (_int_) – 1/2/3 (L/R/W).
319
+
320
+ * **joint_id** (_int_) – 1 - 7 (7 is gripper)
321
+
322
+ ### get_angles(id)
323
+
324
+ Get the degree of all joints.
325
+
326
+ * **Parameters**
327
+
328
+ **id** – 1/2 (L/R)
329
+
330
+ * **Returns**
331
+
332
+ A float list of all degree.
333
+
334
+ * **Return type**
335
+
336
+ list
337
+
338
+ ### get_base_coord(id)
339
+
340
+ Get the base coordinates of the single arm
341
+
342
+ * **Parameters**
343
+
344
+ **id** – 1/2 (L/R)
345
+
346
+ ### get_base_coords(\*args: int)
347
+
348
+ Convert coordinates to base coordinates. Pass in parameters or no parameters
349
+
350
+ * **Parameters**
351
+
352
+ * **coords** – a list of coords value(List[float]), length 6 [x(mm), y, z, rx(angle), ry, rz]
353
+
354
+ * **arm** – 0 - left. 1 - right
355
+
356
+ * **Returns**
357
+
358
+ Base coords
359
+
360
+ ### get_coord(id, joint_id)
361
+
362
+ Read a single coordinate parameter
363
+
364
+ * **Parameters**
365
+
366
+ * **id** (_int_) – 1/2/3 (L/R/W).
367
+
368
+ * **joint_id** (_int_) – 1 - 7 (7 is gripper)
369
+
370
+ ### get_coords(id)
371
+
372
+ Get the coordinates of the robotic arm
373
+
374
+ * **Parameters**
375
+
376
+ **id** – 1/2 (L/R).
377
+
378
+ ### get_digital_input(id, pin_no)
379
+
380
+ singal value
381
+
382
+ * **Parameters**
383
+
384
+ * **id** – 1/2 (L/R)
385
+
386
+ * **pin_no** (_int_) – 1 - 5
387
+
388
+ ### get_encoder(id, joint_id)
389
+
390
+ Obtain the specified joint potential value.
391
+
392
+ * **Parameters**
393
+
394
+ * **id** – 1/2/3 (L/R/W).
395
+
396
+ * **joint_id** – (int) 1 ~ 6
397
+
398
+ * **Returns**
399
+
400
+ 0 ~ 4096
401
+
402
+ ### get_encoders(id)
403
+
404
+ Get the six joints of the manipulator
405
+
406
+ * **Parameters**
407
+
408
+ **id** – 1/2 (L/R).
409
+
410
+ * **Returns**
411
+
412
+ The list of encoders
413
+
414
+ ### get_end_type(id)
415
+
416
+ Get end coordinate system
417
+
418
+ * **Parameters**
419
+
420
+ **id** – 0/1/2 (ALL/L/R)
421
+
422
+ * **Returns**
423
+
424
+ 0 - flange
425
+ 1 - tool
426
+
427
+ ### get_gripper_value(id)
428
+
429
+ Get the value of gripper.
430
+
431
+ * **Parameters**
432
+
433
+ **id** – 1/2 (L/R)
434
+
435
+ * **Returns**
436
+
437
+ gripper value (int)
438
+
439
+ ### get_joint_current(id, joint_id)
440
+
441
+ Get Collision Current
442
+
443
+ * **Parameters**
444
+
445
+ * **id** – 0/1/2 (ALL/L/R)
446
+
447
+ * **joint_id** – 1 - 6
448
+
449
+ ### get_joint_max_angle(id, joint_id)
450
+
451
+ Gets the maximum movement angle of the specified joint
452
+
453
+ * **Parameters**
454
+
455
+ * **id** – 1/2/3 (L/R/W)
456
+
457
+ * **joint_id** – (int) 1 - 6
458
+
459
+ * **Returns**
460
+
461
+ angle value(float)
462
+
463
+ ### get_joint_min_angle(id, joint_id)
464
+
465
+ Gets the minimum movement angle of the specified joint
466
+
467
+ * **Parameters**
468
+
469
+ * **id** – 1/2/3 (L/R/W)
470
+
471
+ * **joint_id** – (int) 1 - 6
472
+
473
+ * **Returns**
474
+
475
+ angle value(float)
476
+
477
+ ### get_movement_type(id)
478
+
479
+ Get movement type
480
+
481
+ * **Parameters**
482
+
483
+ **id** – 0/1/2 (ALL/L/R)
484
+
485
+ * **Returns**
486
+
487
+ 1 - movel
488
+ 0 - moveJ
489
+
490
+ ### get_plan_acceleration(id=0)
491
+
492
+ Get planning acceleration
493
+
494
+ * **Parameters**
495
+
496
+ **id** – 0/1/2/3 (ALL/L/R/W)
497
+
498
+ * **Returns**
499
+
500
+ [movel planning acceleration, movej planning acceleration].
501
+
502
+ ### get_plan_speed(id=0)
503
+
504
+ Get planning speed
505
+
506
+ * **Parameters**
507
+
508
+ **id** – 0/1/2/3 (ALL/L/R/W)
509
+
510
+ * **Returns**
511
+
512
+ [movel planning speed, movej planning speed].
513
+
514
+ ### get_reference_frame(id)
515
+
516
+ Get the base coordinate system
517
+
518
+ * **Parameters**
519
+
520
+ **id** – 0/1/2 (ALL/L/R)
521
+
522
+ * **Returns**
523
+
524
+ 0 - base 1 - tool.
525
+
526
+ ### get_robot_id(id)
527
+
528
+ Detect this robot id
529
+
530
+ * **Parameters**
531
+
532
+ **id** – 0/1/2/3 (ALL/L/R/W)
533
+
534
+ ### get_robot_version(id)
535
+
536
+ Get cobot version
537
+
538
+ * **Parameters**
539
+
540
+ **id** – 0/1/2/3 (ALL/L/R/W)
541
+
542
+ ### get_servo_currents(id)
543
+
544
+ Get joint current
545
+
546
+ * **Parameters**
547
+
548
+ **id** – 1/2/3 (L/R/W)
549
+
550
+ * **Returns**
551
+
552
+ value mA
553
+
554
+ ### get_servo_data(id, servo_no, data_id)
555
+
556
+ Read the data parameter of the specified address of the steering gear.
557
+
558
+ * **Parameters**
559
+
560
+ * **id** – 1/2/3 (L/R/W)
561
+
562
+ * **servo_no** – Serial number of articulated steering gear, 1 - 6.
563
+
564
+ * **data_id** – Data address.
565
+
566
+ * **Returns**
567
+
568
+ values (0 - 4096)
569
+ 0 - disable
570
+ 1 - enable
571
+ -1 - error
572
+
573
+ ### get_servo_status(id)
574
+
575
+ Get joint status
576
+
577
+ * **Parameters**
578
+
579
+ **id** – 1/2/3 (L/R/W)
580
+
581
+ * **Returns**
582
+
583
+ [voltage, sensor, temperature, current, angle, overload], a value of 0 means no error
584
+
585
+ ### get_servo_spees(id)
586
+
587
+ Get joint speed
588
+
589
+ * **Parameters**
590
+
591
+ **id** – 1/2/ (L/R)
592
+
593
+ * **Returns**
594
+
595
+ list len 6
596
+
597
+ ### get_servo_temps(id)
598
+
599
+ Get joint temperature
600
+
601
+ * **Parameters**
602
+
603
+ **id** – 1/2/3 (L/R/W)
604
+
605
+ ### get_servo_voltages(id)
606
+
607
+ Get joint voltages
608
+
609
+ * **Parameters**
610
+
611
+ **id** – 1/2/3 (L/R/W)
612
+
613
+ * **Returns**
614
+
615
+ volts < 24 V
616
+
617
+ ### get_speed(id)
618
+
619
+ Get speed
620
+
621
+ * **Parameters**
622
+
623
+ **id** – 1/2/3 (L/R/W).
624
+
625
+ * **Returns**
626
+
627
+ speed
628
+
629
+ * **Return type**
630
+
631
+ int
632
+
633
+ ### get_system_version(id)
634
+
635
+ Get cobot version
636
+
637
+ * **Parameters**
638
+
639
+ **id** – 0/1/2/3 (ALL/L/R/W)
640
+
641
+ ### get_tool_reference(id)
642
+
643
+ Get tool coordinate system
644
+
645
+ * **Parameters**
646
+
647
+ **id** – 0/1/2 (ALL/L/R)
648
+
649
+ ### get_world_reference(id)
650
+
651
+ Get the world coordinate system
652
+
653
+ * **Parameters**
654
+
655
+ **id** – 0/1/2 (ALL/L/R)
656
+
657
+ ### is_all_servo_enable(id)
658
+
659
+ Determine whether the specified steering gear is connected
660
+
661
+ * **Parameters**
662
+
663
+ **id** – 1/2/3 (L/R/W)
664
+
665
+ * **Returns**
666
+
667
+ 0 - disable
668
+ 1 - enable
669
+ -1 - error
670
+
671
+ ### is_collision_on()
672
+
673
+ Get collision detection status
674
+
675
+ ### is_controller_connected(id=0)
676
+
677
+ Wether connected with Atom.
678
+
679
+ * **Parameters**
680
+
681
+ **id** – 0/1/2/3 (ALL/L/R/W)
682
+
683
+ ### is_free_mode(id)
684
+
685
+ Check if it is free mode
686
+
687
+ * **Parameters**
688
+
689
+ **id** – 0/1/2/3 (ALL/L/R/W)
690
+
691
+ * **Returns**
692
+
693
+ 0/1
694
+
695
+ ### is_gripper_moving(id)
696
+
697
+ Judge whether the gripper is moving or not
698
+
699
+ * **Parameters**
700
+
701
+ **id** – 1/2 (L/R)
702
+
703
+ * **Returns**
704
+
705
+ 0 - not moving
706
+ 1 - is moving
707
+ -1 - error data
708
+
709
+ ### is_in_position(id, data, mode)
710
+
711
+ Judge whether in the position.
712
+
713
+ * **Parameters**
714
+
715
+ * **id** – 0/1/2/3 (ALL/L/R/W).
716
+
717
+ * **data** – A data list, angles or coords. If id is 1/2. data length is 6. If id is 0. data len 13. if id is 3. data len 1
718
+
719
+ * **mode** – 1 - coords, 0 - angles
720
+
721
+ * **Returns**
722
+
723
+ 1 - True
724
+ 0 - False
725
+ -1 - Error
726
+
727
+ ### is_moving(id)
728
+
729
+ Detect if the robot is moving
730
+
731
+ * **Parameters**
732
+
733
+ **id** – 0/1/2/3 (ALL/L/R/W).
734
+
735
+ * **Returns**
736
+
737
+ 0 - not moving
738
+ 1 - is moving
739
+ -1 - error data
740
+
741
+ ### is_paused(id)
742
+
743
+ Judge whether the manipulator pauses or not.
744
+
745
+ * **Parameters**
746
+
747
+ **id** – 0/1/2/3 (ALL/L/R/W).
748
+
749
+ * **Returns**
750
+
751
+ 1 - paused
752
+ 0 - not paused
753
+ -1 - error
754
+
755
+ ### is_power_on(id=0)
756
+
757
+ Adjust robot arm status
758
+
759
+ * **Parameters**
760
+
761
+ **id** – 0/1/2/3 (ALL/L/R/W)
762
+
763
+ * **Returns**
764
+
765
+ 1 - power on
766
+ 0 - power off
767
+ -1 - error data
768
+
769
+ ### is_servo_enable(id, servo_id)
770
+
771
+ Determine whether all steering gears are connected
772
+
773
+ * **Parameters**
774
+
775
+ * **id** – 1/2/3 (L/R/W)
776
+
777
+ * **servo_id** – (int) 1 ~ 6
778
+
779
+ * **Returns**
780
+
781
+ 0 - disable
782
+ 1 - enable
783
+ -1 - error
784
+
785
+ ### jog_absolute(id, joint_id, angle, speed)
786
+
787
+ Absolute joint control
788
+
789
+ * **Parameters**
790
+
791
+ * **id** – 1/2/3 (L/R/W).
792
+
793
+ * **joint_id** – int 1-6.
794
+
795
+ * **angle** – int
796
+
797
+ * **speed** – int (0 - 100)
798
+
799
+ ### jog_angle(id, joint_id, direction, speed)
800
+
801
+ Jog control angle.
802
+
803
+ * **Parameters**
804
+
805
+ * **id** – 1/2/3 (L/R/W).
806
+
807
+ * **joint_id** – int 1-6.
808
+
809
+ * **direction** – 0 - decrease, 1 - increase
810
+
811
+ * **speed** – int (0 - 100)
812
+
813
+ ### jog_coord(id, coord_id, direction, speed)
814
+
815
+ Jog control coord.
816
+
817
+ * **Parameters**
818
+
819
+ * **id** – 1/2/3 (L/R/W).
820
+
821
+ * **coord_id** – int 1-6 (x/y/z/rx/ry/rz).
822
+
823
+ * **direction** – 0 - decrease, 1 - increase
824
+
825
+ * **speed** – int (0 - 100)
826
+
827
+ ### jog_inc_coord(axis, increment, speed)
828
+
829
+ Double-arm coordinated coordinate stepping
830
+
831
+ * **Parameters**
832
+
833
+ * **axis** – 1 - 6 (x/y/z/rx/ry/rz)
834
+
835
+ * **increment** –
836
+
837
+ * **speed** – 1 - 100
838
+
839
+ ### jog_increment(id, joint_id, increment, speed)
840
+
841
+ step mode
842
+
843
+ * **Parameters**
844
+
845
+ * **id** – 1/2/3 (L/R/W).
846
+
847
+ * **joint_id** – int 1-6.
848
+
849
+ * **increment** –
850
+
851
+ * **speed** – int (1 - 100)
852
+
853
+ ### jog_stop(id)
854
+
855
+ Stop jog moving
856
+
857
+ * **Parameters**
858
+
859
+ **id** – 1/2/3 (L/R/W).
860
+
861
+ ### joint_brake(id, joint_id)
862
+
863
+ Make it stop when the joint is in motion, and the buffer distance is positively related to the existing speed
864
+
865
+ * **Parameters**
866
+
867
+ * **id** – 1/2/3 (L/R/W)
868
+
869
+ * **joint_id** – 1 - 6
870
+
871
+ ### pause(id)
872
+
873
+ Pause movement
874
+
875
+ * **Parameters**
876
+
877
+ **id** – 0/1/2/3 (ALL/L/R/W).
878
+
879
+ ### power_off(id=0)
880
+
881
+ Close communication with Atom.
882
+
883
+ * **Parameters**
884
+
885
+ **id** – 0/1/2/3 (ALL/L/R/W)
886
+
887
+ ### power_on(id=0)
888
+
889
+ Open communication with Atom.
890
+
891
+ * **Parameters**
892
+
893
+ **id** – 0/1/2/3 (ALL/L/R/W)
894
+
895
+ ### read_next_error(id=0)
896
+
897
+ Robot Error Detection
898
+
899
+ * **Parameters**
900
+
901
+ **id** – 0/1/2/3 (ALL/L/R/W)
902
+
903
+ ### release_all_servos(id=0)
904
+
905
+ Robot turns off torque output
906
+
907
+ * **Parameters**
908
+
909
+ **id** – 0/1/2/3 (ALL/L/R/W)
910
+
911
+ ### release_servo(id, servo_id)
912
+
913
+ Power off designated servo
914
+
915
+ * **Parameters**
916
+
917
+ * **id** – 1/2/3 (L/R/W)
918
+
919
+ * **servo_id** – 1 - 6.
920
+
921
+ ### resume(id)
922
+
923
+ Recovery movement
924
+
925
+ * **Parameters**
926
+
927
+ **id** – 0/1/2/3 (ALL/L/R/W).
928
+
929
+ ### send_angle(id, joint, angle, speed)
930
+
931
+ Send one degree of joint to robot arm.
932
+
933
+ * **Parameters**
934
+
935
+ * **id** – 1/2/3 (L/R/W)
936
+
937
+ * **joint** – 1 ~ 6
938
+
939
+ * **angle** – int
940
+
941
+ * **speed** – 1 ~ 100
942
+
943
+ ### send_angles(id, degrees, speed)
944
+
945
+ Send all angles to the robotic arm
946
+
947
+ * **Parameters**
948
+
949
+ * **id** – 1/2 (L/R).
950
+
951
+ * **degrees** – [angle_list] len 6
952
+
953
+ * **speed** – 1 - 100
954
+
955
+ ### send_coord(id, coord, data, speed)
956
+
957
+ Send a single coordinate to the robotic arm
958
+
959
+ * **Parameters**
960
+
961
+ * **id** – 1/2/3 (L/R/W).
962
+
963
+ * **coord** – 1 ~ 6 (x/y/z/rx/ry/rz)
964
+
965
+ * **data** – Coordinate value
966
+
967
+ * **speed** – 0 ~ 100
968
+
969
+ ### send_coords(id, coords, speed, mode)
970
+
971
+ Send all coords to robot arm.
972
+
973
+ * **Parameters**
974
+
975
+ * **id** – 1/2 (L/R).
976
+
977
+ * **coords** – a list of coords value(List[float]), length 6, [x(mm), y, z, rx(angle), ry, rz]
978
+
979
+ * **speed** – (int) 0 ~ 100
980
+
981
+ * **mode** – (int) 0 - moveJ, 1 - moveL, 2 - moveC
982
+
983
+ ### set_acceleration(id, acc)
984
+
985
+ Read acceleration during all moves
986
+
987
+ * **Parameters**
988
+
989
+ * **id** – 1/2/3 (L/R/W)
990
+
991
+ * **acc** – 1 - 100
992
+
993
+ ### set_color(id, r=0, g=0, b=0)
994
+
995
+ Set the light color on the top of the robot arm.
996
+
997
+ * **Parameters**
998
+
999
+ * **id** – 1/2 (L/R)
1000
+
1001
+ * **r** (_int_) – 0 ~ 255
1002
+
1003
+ * **g** (_int_) – 0 ~ 255
1004
+
1005
+ * **b** (_int_) – 0 ~ 255
1006
+
1007
+ ### set_digital_output(id, pin_no, pin_signal)
1008
+
1009
+ Set atom IO output level
1010
+
1011
+ * **Parameters**
1012
+
1013
+ * **id** – 1/2 (L/R)
1014
+
1015
+ * **pin_no** (_int_) – 1 - 5
1016
+
1017
+ * **pin_signal** (_int_) – 0 / 1
1018
+
1019
+ ### set_encoder(id, joint_id, encoder, speed)
1020
+
1021
+ Set a single joint rotation to the specified potential value.
1022
+
1023
+ * **Parameters**
1024
+
1025
+ * **id** – 1/2/3 (L/R/W).
1026
+
1027
+ * **joint_id** – 1 - 6.
1028
+
1029
+ * **encoder** – The value of the set encoder.
1030
+
1031
+ ### set_encoders(id, encoders, speed)
1032
+
1033
+ Set the six joints of the manipulator to execute synchronously to the specified position.
1034
+
1035
+ * **Parameters**
1036
+
1037
+ * **id** – 1/2 (L/R).
1038
+
1039
+ * **encoders** – A encoder list, length 6.
1040
+
1041
+ * **speed** – speed 1 ~ 100
1042
+
1043
+ ### set_end_type(id, end)
1044
+
1045
+ Set end coordinate system
1046
+
1047
+ * **Parameters**
1048
+
1049
+ * **id** – 0/1/2 (ALL/L/R)
1050
+
1051
+ * **end** – 0 - flange, 1 - tool
1052
+
1053
+ ### set_encoders_drag(id, encoders, speeds)
1054
+
1055
+ Send all encoders and speeds
1056
+
1057
+ - **Parameters**
1058
+
1059
+ * **encoders** - (`list`) : encoders list.
1060
+ * **speeds** - Obtained by the get_servo_speeds() method
1061
+
1062
+ ### set_free_mode(id, value)
1063
+
1064
+ set free mode
1065
+
1066
+ * **Parameters**
1067
+
1068
+ * **id** – 0/1/2/3 (ALL/L/R/W)
1069
+
1070
+ * **value** – 0 - close 1 - open
1071
+
1072
+ ### set_fresh_mode(id, mode)
1073
+
1074
+ Set command refresh mode
1075
+
1076
+ * **Parameters**
1077
+
1078
+ * **id** – 1/2 (L/R).
1079
+
1080
+ * **mode** – int
1081
+ 1 - Always execute the latest command first.
1082
+ 0 - Execute instructions sequentially in the form of a queue.
1083
+
1084
+ ### set_gripper_calibration(id)
1085
+
1086
+ Set the current position to zero, set current position value is 2048.
1087
+
1088
+ * **Parameters**
1089
+
1090
+ **id** – 1/2 (L/R)
1091
+
1092
+ ### set_gripper_state(id, flag)
1093
+
1094
+ Set gripper switch state
1095
+
1096
+ * **Parameters**
1097
+
1098
+ * **id** – 1/2 (L/R)
1099
+
1100
+ * **flag** (_int_) – 0 - close, 1 - open
1101
+
1102
+ ### set_gripper_value(id, value, speed)
1103
+
1104
+ Set gripper value
1105
+
1106
+ * **Parameters**
1107
+
1108
+ * **id** – 1/2 (L/R)
1109
+
1110
+ * **value** (_int_) – 0 ~ 100
1111
+
1112
+ * **speed** (_int_) – 0 ~ 100
1113
+
1114
+ ### set_joint_current(id, joint_id, current)
1115
+
1116
+ Set Collision Current
1117
+
1118
+ * **Parameters**
1119
+
1120
+ * **id** – 0/1/2 (ALL/L/R)
1121
+
1122
+ * **joint_id** – 1 - 6
1123
+
1124
+ * **current** – current value
1125
+
1126
+ ### set_joint_max(id, joint_id, angle)
1127
+
1128
+ Set the joint maximum angle
1129
+
1130
+ * **Parameters**
1131
+
1132
+ * **id** – 1/2/3 (L/R/W)
1133
+
1134
+ * **joint_id** – int 1-6.
1135
+
1136
+ * **angle** – 0 ~ 180
1137
+
1138
+ ### set_joint_min(id, joint_id, angle)
1139
+
1140
+ Set the joint minimum angle
1141
+
1142
+ * **Parameters**
1143
+
1144
+ * **id** – 1/2/3 (L/R/W)
1145
+
1146
+ * **joint_id** – int 1-6.
1147
+
1148
+ * **angle** – 0 ~ 180
1149
+
1150
+ ### set_movement_type(id, move_type)
1151
+
1152
+ Set movement type
1153
+
1154
+ * **Parameters**
1155
+
1156
+ * **id** – 0/1/2 (ALL/L/R)
1157
+
1158
+ * **move_type** – 1 - movel, 0 - moveJ
1159
+
1160
+ ### set_pin_mode(id, pin_no, pin_mode)
1161
+
1162
+ Set the state mode of the specified pin in atom.
1163
+
1164
+ * **Parameters**
1165
+
1166
+ * **id** – 1/2 (L/R)
1167
+
1168
+ * **pin_no** (_int_) – pin number (1 - 5).
1169
+
1170
+ * **pin_mode** (_int_) – 0 - input, 1 - output
1171
+
1172
+ ### set_plan_acceleration(id, acceleration)
1173
+
1174
+ Set planning acceleration
1175
+
1176
+ * **Parameters**
1177
+
1178
+ * **id** – 0/1/2/3 (ALL/L/R/W)
1179
+
1180
+ * **acceleration** (_int_) – (0 ~ 100).
1181
+
1182
+ ### set_plan_speed(id, speed)
1183
+
1184
+ Set planning speed
1185
+
1186
+ * **Parameters**
1187
+
1188
+ * **id** – 0/1/2/3 (ALL/L/R/W)
1189
+
1190
+ * **speed** (_int_) – (0 ~ 100).
1191
+
1192
+ ### set_pwm_output()
1193
+
1194
+ Set PWM output
1195
+
1196
+ ### set_reference_frame(id, rftype)
1197
+
1198
+ Set the base coordinate system
1199
+
1200
+ * **Parameters**
1201
+
1202
+ * **id** – 0/1/2 (ALL/L/R)
1203
+
1204
+ * **rftype** – 0 - base 1 - tool.
1205
+
1206
+ ### set_robot_id(id, new_id)
1207
+
1208
+ Set this robot id
1209
+
1210
+ * **Parameters**
1211
+
1212
+ * **id** – 0/1/2/3 (ALL/L/R/W)
1213
+
1214
+ * **new_id** – 1 - 253
1215
+
1216
+ ### set_servo_calibration(id, servo_no)
1217
+
1218
+ The current position of the calibration joint actuator is the angle zero point,
1219
+
1220
+ and the corresponding potential value is 2048.
1221
+
1222
+ * **Parameters**
1223
+
1224
+ * **id** – 1/2/3 (L/R/W)
1225
+
1226
+ * **servo_no** – Serial number of articulated steering gear, 1 - 6.
1227
+
1228
+ ### set_servo_data(id, servo_no, data_id, value)
1229
+
1230
+ Set the data parameters of the specified address of the steering gear
1231
+
1232
+ * **Parameters**
1233
+
1234
+ * **id** – 1/2/3 (L/R/W)
1235
+
1236
+ * **servo_no** – Serial number of articulated steering gear, 1 - 6.
1237
+
1238
+ * **data_id** – Data address.
1239
+
1240
+ * **value** – 0 - 4096
1241
+
1242
+ ### set_speed(id, speed)
1243
+
1244
+ Set speed value
1245
+
1246
+ * **Parameters**
1247
+
1248
+ * **id** – 1/2/3 (L/R/W)
1249
+
1250
+ * **speed** (_int_) – 0 - 100
1251
+
1252
+ ### set_tool_reference(id, coords)
1253
+
1254
+ Set tool coordinate system
1255
+
1256
+ * **Parameters**
1257
+
1258
+ * **id** – 0/1/2 (ALL/L/R)
1259
+
1260
+ * **coords** – a list of coords value(List[float]), length 6. [x(mm), y, z, rx(angle), ry, rz]
1261
+
1262
+ ### set_world_reference(id, coords)
1263
+
1264
+ Set the world coordinate system
1265
+
1266
+ * **Parameters**
1267
+
1268
+ * **id** – 0/1/2 (ALL/L/R)
1269
+
1270
+ * **coords** – a list of coords value(List[float]), length 6 [x(mm), y, z, rx(angle), ry, rz]
1271
+
1272
+ ### stop(id)
1273
+
1274
+ Stop moving
1275
+
1276
+ * **Parameters**
1277
+
1278
+ **id** – 0/1/2/3 (ALL/L/R/W).
1279
+
1280
+ ### write_base_coord(id, axis, coord, speed)
1281
+
1282
+ Base single coordinate movement
1283
+
1284
+ * **Parameters**
1285
+
1286
+ * **id** – 1/2 (L/R)
1287
+
1288
+ * **axis** – 1 - 6 (x/y/z/rx/ry/rz)
1289
+
1290
+ * **coord** – Coordinate value
1291
+
1292
+ * **speed** – 1 - 100
1293
+
1294
+ ### write_base_coords(id, coords, speed)
1295
+
1296
+ base coordinate move
1297
+
1298
+ * **Parameters**
1299
+
1300
+ * **id** – 1/2 (L/R)
1301
+
1302
+ * **coords** – coords: a list of coords value(List[float]), length 6, [x(mm), y, z, rx(angle), ry, rz]
1303
+
1304
+ * **speed** – 1 - 100
1305
+
1306
+
1307
+
1308
+ ### get_radians(id)
1309
+
1310
+ Get the radians of all joints
1311
+
1312
+ * **Parameters**
1313
+
1314
+ **id** – 1/2 (L/R)
1315
+
1316
+ * **Returns**
1317
+
1318
+ A list of float radians [radian1, …]
1319
+
1320
+ * **Return type**
1321
+
1322
+ list
1323
+
1324
+ ### send_radians(id, radians, speed)
1325
+
1326
+ Send the radians of all joints to robot arm
1327
+
1328
+ * **Parameters**
1329
+
1330
+ * **id** – 1/2 (L/R).
1331
+
1332
+ * **radians** – a list of radian values( List[float]), length 6
1333
+
1334
+ * **speed** – (int )1 ~ 100
1335
+
1336
+ ### set_gpio_input(pin)
1337
+
1338
+ Set GPIO input value.
1339
+
1340
+ * **Parameters**
1341
+
1342
+ **pin** – (int)pin number.
1343
+
1344
+ ### set_gpio_mode(pin_no, mode)
1345
+
1346
+ Init GPIO module, and set BCM mode.
1347
+
1348
+ * **Parameters**
1349
+
1350
+ * **pin_no** – (int)pin number.
1351
+
1352
+ * **mode** – 0 - input 1 - output
1353
+
1354
+ ### set_gpio_output(pin, v)
1355
+
1356
+ Set GPIO output value.
1357
+
1358
+ * **Parameters**
1359
+
1360
+ * **pin** – (int)pin number.
1361
+
1362
+ * **v** – (int) 0 / 1
1363
+
1364
+ ### set_gpio_pwm(pin, baud, dc)
1365
+
1366
+ Set GPIO PWM value.
1367
+
1368
+ * **Parameters**
1369
+
1370
+ * **pin** – (int)pin number.
1371
+
1372
+ * **baud** – (int) 10 - 1000000
1373
+
1374
+ * **dc** – (int) 0 - 100
1375
+
1376
+
1377
+ # MyBuddyEmoticon
1378
+
1379
+ ## MyBuddyEmoticon(file_path: list = [], window_size: tuple = [], loop=False)
1380
+
1381
+ API for playing emoticons
1382
+
1383
+ * **Parameters**
1384
+ * **file_path** - `[[path, time],...]` The absolute path of facial expression video and the length of time to play.Time in seconds.
1385
+
1386
+ * **window_size** - `(Length, width) `Size of the playback window (default is full screen).
1387
+
1388
+ * **loop** - Loop playback or not (only once by default).
1389
+
1390
+ ```python
1391
+ from pymycobot import MyBuddyEmoticon
1392
+ import time
1393
+
1394
+ # playlist
1395
+ file_path = [
1396
+ ['/home/er/emo/look_happy.mp4', 10],
1397
+ ]
1398
+ # Initialize the object and set it to loop playback
1399
+ em = MyBuddyEmoticon(file_path, loop = True)
1400
+ # Start playing
1401
+ em.start()
1402
+
1403
+ # Pause playback after 3 seconds
1404
+ # time.sleep(3)
1405
+ # em.pause()
1406
+
1407
+ # Continue playing
1408
+ # em.run()
1409
+
1410
+ # The main thread waits for the completion of playback
1411
+ em.join()
1412
+ ```
1413
+
1414
+ ### add_file_path(path_time: list)
1415
+ Add Playback File
1416
+
1417
+
1418
+ * **Parameters**
1419
+
1420
+ **path_time** – [path, time] The video address to be added and the running time
1421
+
1422
+
1423
+
1424
+ ### del_file_path(index: int)
1425
+ Delete the element with the specified subscript in the playlist list
1426
+
1427
+
1428
+ * **Parameters**
1429
+
1430
+ **index** – The subscript of the element in the playlist to be deleted
1431
+
1432
+
1433
+
1434
+ ### file_path
1435
+ Get Playfile List
1436
+
1437
+
1438
+ * **Returns**
1439
+
1440
+ list
1441
+
1442
+
1443
+
1444
+ ### join()
1445
+ Wait for the thread playing the video to finish
1446
+
1447
+
1448
+ ### pause()
1449
+ Pause playback
1450
+
1451
+ ### run()
1452
+ Continue playing
1453
+
1454
+
1455
+ ### start()
1456
+ Start playing
1457
+
1458
+ ---
1459
+ More demo can go to [here](../demo).