# This is Python API for ElephantRobotics product


[](https://pypi.org/project/pigit)
This is a python API for serial communication with mycobot and controlling it.
[](https://www.elephantrobotics.com/en/myCobot-en/)
## Installation
**Notes**:
> Make sure that `Atom` is flashed into the top Atom, `Transponder` is flashed into the base Basic. <br>
> The firmware `Atom` and `Transponder` download address: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)<br>
> You also can use myStudio to flash them, myStudio address: [https://github.com/elephantrobotics/myStudio/releases](https://github.com/elephantrobotics/myStudio/releases)
### Pip
```bash
pip install pymycobot --upgrade
```
<!--
**Notes:**
> Now only the version is `Atom2.4` or later is supported. If you use an earlier version, please install `pymycobot 1.0.7`.
```bash
pip install pymycobot==1.0.7 --user
```
-->
### Source code
```bash
git clone https://github.com/elephantrobotics/pymycobot.git <your-path>
cd <your-path>/pymycobot
# Install
[sudo] python2 setup.py install
# or
[sudo] python3 setup.py install
```
Or the more modern form:
```bash
# Install
pip install .
# Uninstall
pip uninstall .
```
## Usage:
```python
# for mycobot 280 machine
from pymycobot import MyCobot280
from pymycobot import MyCobot280Socket
# for mycobot 320 machine
from pymycobot import MyCobot320
from pymycobot import MyCobot320Socket
# for mecharm 270 machine
from pymycobot import MechArm270
from pymycobot import MechArmSocket
# for mypalletizer 260 machine
from pymycobot import MyPalletizer260
from pymycobot import MyPalletizerSocket
```
The [`demo`](./demo) directory stores some test case files.
You can find out which interfaces pymycobot provides in `pymycobot/README.md`.
Please go to [here](./docs/README.md).
> 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:
 
[MyCobot 280 API说明](./docs/MyCobot_280_zh.md) | [MyCobot 280 API Description](./docs/MyCobot_280_en.md)
[MyCobot 320 API说明](./docs/MyCobot_320_zh.md) | [MyCobot 320 API Description](./docs/MyCobot_320_en.md)
[MechArm 270 API说明](./docs/MechArm_270_zh.md) | [MechArm 270 API Description](./docs/MechArm_270_en.md)
[MyPalletizer 260 API说明](./docs/MyPalletizer_260_zh.md) | [MyPalletizer 260 API Description](./docs/MyPalletizer_260_en.md)
[myAGV API说明](./docs/myAGV_zh.md) | [myAGV API Description](./docs/myAGV_en.md)
[myArm_M&C API说明](./docs/myArm_M&C_zh.md) | [myArm_M&C API Description](./docs/myArm_M&C_en.md)
[ultraArm P340 API说明](./docs/ultraArm_P340_zh.md) | [ultraArm P340 API Description](./docs/ultraArm_P340_en.md)# pymycobot
**This is python API for ElephantRobotics product**
We support Python2, Python3.5 or later.
 
[MyCobot 280 API说明](./MyCobot_280_zh.md) | [MyCobot 280 API Description](./MyCobot_280_en.md)
[MyCobot 320 API说明](./MyCobot_320_zh.md) | [MyCobot 320 API Description](./MyCobot_320_en.md)
[MechArm 270 API说明](./MechArm_270_zh.md) | [MechArm 270 API Description](./MechArm_270_en.md)
[MyPalletizer 260 API说明](./MyPalletizer_260_zh.md) | [MyPalletizer 260 API Description](./MyPalletizer_260_en.md)
[myAGV API说明](./myAGV_zh.md) | [myAGV API Description](./myAGV_en.md)
[myArm_M&C API说明](./myArm_M&C_zh.md) | [myArm_M&C API Description](./myArm_M&C_en.md)
[ultraArm P340 API说明](./ultraArm_P340_zh.md) | [ultraArm P340 API Description](./ultraArm_P340_en.md)
<details>
<summary>Catalogue:</summary>
<!-- vim-markdown-toc GFM -->
- [pymycobot](#pymycobot)
- [MyBuddy](#mybuddy)
- [base\_to\_single\_coords(base\_coords, arm)](#base_to_single_coordsbase_coords-arm)
- [collision(left\_angles, right\_angles)](#collisionleft_angles-right_angles)
- [collision\_switch(state)](#collision_switchstate)
- [focus\_servo(id, servo\_id)](#focus_servoid-servo_id)
- [get\_acceleration(id)](#get_accelerationid)
- [get\_angle(id, joint\_id)](#get_angleid-joint_id)
- [get\_angles(id)](#get_anglesid)
- [get\_base\_coord(id)](#get_base_coordid)
- [get\_base\_coords(\*args: int)](#get_base_coordsargs-int)
- [get\_coord(id, joint\_id)](#get_coordid-joint_id)
- [get\_coords(id)](#get_coordsid)
- [get\_digital\_input(id, pin\_no)](#get_digital_inputid-pin_no)
- [get\_encoder(id, joint\_id)](#get_encoderid-joint_id)
- [get\_encoders(id)](#get_encodersid)
- [get\_end\_type(id)](#get_end_typeid)
- [get\_gripper\_value(id)](#get_gripper_valueid)
- [get\_joint\_current(id, joint\_id)](#get_joint_currentid-joint_id)
- [get\_joint\_max\_angle(id, joint\_id)](#get_joint_max_angleid-joint_id)
- [get\_joint\_min\_angle(id, joint\_id)](#get_joint_min_angleid-joint_id)
- [get\_movement\_type(id)](#get_movement_typeid)
- [get\_plan\_acceleration(id=0)](#get_plan_accelerationid0)
- [get\_plan\_speed(id=0)](#get_plan_speedid0)
- [get\_reference\_frame(id)](#get_reference_frameid)
- [get\_robot\_id(id)](#get_robot_idid)
- [get\_robot\_version(id)](#get_robot_versionid)
- [get\_servo\_currents(id)](#get_servo_currentsid)
- [get\_servo\_data(id, servo\_no, data\_id)](#get_servo_dataid-servo_no-data_id)
- [get\_servo\_status(id)](#get_servo_statusid)
- [get\_servo\_spees(id)](#get_servo_speesid)
- [get\_servo\_temps(id)](#get_servo_tempsid)
- [get\_servo\_voltages(id)](#get_servo_voltagesid)
- [get\_speed(id)](#get_speedid)
- [get\_system\_version(id)](#get_system_versionid)
- [get\_tool\_reference(id)](#get_tool_referenceid)
- [get\_world\_reference(id)](#get_world_referenceid)
- [is\_all\_servo\_enable(id)](#is_all_servo_enableid)
- [is\_collision\_on()](#is_collision_on)
- [is\_controller\_connected(id=0)](#is_controller_connectedid0)
- [is\_free\_mode(id)](#is_free_modeid)
- [is\_gripper\_moving(id)](#is_gripper_movingid)
- [is\_in\_position(id, data, mode)](#is_in_positionid-data-mode)
- [is\_moving(id)](#is_movingid)
- [is\_paused(id)](#is_pausedid)
- [is\_power\_on(id=0)](#is_power_onid0)
- [is\_servo\_enable(id, servo\_id)](#is_servo_enableid-servo_id)
- [jog\_absolute(id, joint\_id, angle, speed)](#jog_absoluteid-joint_id-angle-speed)
- [jog\_angle(id, joint\_id, direction, speed)](#jog_angleid-joint_id-direction-speed)
- [jog\_coord(id, coord\_id, direction, speed)](#jog_coordid-coord_id-direction-speed)
- [jog\_inc\_coord(axis, increment, speed)](#jog_inc_coordaxis-increment-speed)
- [jog\_increment(id, joint\_id, increment, speed)](#jog_incrementid-joint_id-increment-speed)
- [jog\_stop(id)](#jog_stopid)
- [joint\_brake(id, joint\_id)](#joint_brakeid-joint_id)
- [pause(id)](#pauseid)
- [power\_off(id=0)](#power_offid0)
- [power\_on(id=0)](#power_onid0)
- [read\_next\_error(id=0)](#read_next_errorid0)
- [release\_all\_servos(id=0)](#release_all_servosid0)
- [release\_servo(id, servo\_id)](#release_servoid-servo_id)
- [resume(id)](#resumeid)
- [send\_angle(id, joint, angle, speed)](#send_angleid-joint-angle-speed)
- [send\_angles(id, degrees, speed)](#send_anglesid-degrees-speed)
- [send\_coord(id, coord, data, speed)](#send_coordid-coord-data-speed)
- [send\_coords(id, coords, speed, mode)](#send_coordsid-coords-speed-mode)
- [set\_acceleration(id, acc)](#set_accelerationid-acc)
- [set\_color(id, r=0, g=0, b=0)](#set_colorid-r0-g0-b0)
- [set\_digital\_output(id, pin\_no, pin\_signal)](#set_digital_outputid-pin_no-pin_signal)
- [set\_encoder(id, joint\_id, encoder, speed)](#set_encoderid-joint_id-encoder-speed)
- [set\_encoders(id, encoders, speed)](#set_encodersid-encoders-speed)
- [set\_end\_type(id, end)](#set_end_typeid-end)
- [set\_encoders\_drag(id, encoders, speeds)](#set_encoders_dragid-encoders-speeds)
- [set\_free\_mode(id, value)](#set_free_modeid-value)
- [set\_fresh\_mode(id, mode)](#set_fresh_modeid-mode)
- [set\_gripper\_calibration(id)](#set_gripper_calibrationid)
- [set\_gripper\_state(id, flag)](#set_gripper_stateid-flag)
- [set\_gripper\_value(id, value, speed)](#set_gripper_valueid-value-speed)
- [set\_joint\_current(id, joint\_id, current)](#set_joint_currentid-joint_id-current)
- [set\_joint\_max(id, joint\_id, angle)](#set_joint_maxid-joint_id-angle)
- [set\_joint\_min(id, joint\_id, angle)](#set_joint_minid-joint_id-angle)
- [set\_movement\_type(id, move\_type)](#set_movement_typeid-move_type)
- [set\_pin\_mode(id, pin\_no, pin\_mode)](#set_pin_modeid-pin_no-pin_mode)
- [set\_plan\_acceleration(id, acceleration)](#set_plan_accelerationid-acceleration)
- [set\_plan\_speed(id, speed)](#set_plan_speedid-speed)
- [set\_pwm\_output()](#set_pwm_output)
- [set\_reference\_frame(id, rftype)](#set_reference_frameid-rftype)
- [set\_robot\_id(id, new\_id)](#set_robot_idid-new_id)
- [set\_servo\_calibration(id, servo\_no)](#set_servo_calibrationid-servo_no)
- [set\_servo\_data(id, servo\_no, data\_id, value)](#set_servo_dataid-servo_no-data_id-value)
- [set\_speed(id, speed)](#set_speedid-speed)
- [set\_tool\_reference(id, coords)](#set_tool_referenceid-coords)
- [set\_world\_reference(id, coords)](#set_world_referenceid-coords)
- [stop(id)](#stopid)
- [write\_base\_coord(id, axis, coord, speed)](#write_base_coordid-axis-coord-speed)
- [write\_base\_coords(id, coords, speed)](#write_base_coordsid-coords-speed)
- [get\_radians(id)](#get_radiansid)
- [send\_radians(id, radians, speed)](#send_radiansid-radians-speed)
- [set\_gpio\_input(pin)](#set_gpio_inputpin)
- [set\_gpio\_mode(pin\_no, mode)](#set_gpio_modepin_no-mode)
- [set\_gpio\_output(pin, v)](#set_gpio_outputpin-v)
- [set\_gpio\_pwm(pin, baud, dc)](#set_gpio_pwmpin-baud-dc)
- [MyBuddyEmoticon](#mybuddyemoticon)
- [MyBuddyEmoticon(file\_path: list = \[\], window\_size: tuple = \[\], loop=False)](#mybuddyemoticonfile_path-list---window_size-tuple---loopfalse)
- [add\_file\_path(path\_time: list)](#add_file_pathpath_time-list)
- [del\_file\_path(index: int)](#del_file_pathindex-int)
- [file\_path](#file_path)
- [join()](#join)
- [pause()](#pause)
- [run()](#run)
- [start()](#start)
<!-- vim-markdown-toc -->
</details>
# MyBuddy
### base_to_single_coords(base_coords, arm)
Convert base coordinates to coordinates
* **Parameters**
* **coords** – a list of base coords value len 6
* **arm** – 0 - left. 1 - right
* **Returns**
coords
### collision(left_angles, right_angles)
Collision detection main program
* **Parameters**
* **left_angles** – left arm angle len 6.
* **right_angles** – right arm angle len 6.
* **Returns**
int
### collision_switch(state)
Collision Detection Switch
* **Parameters**
**state** (_int_) – 0 - close 1 - open (Off by default)
### focus_servo(id, servo_id)
Power on designated servo
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **servo_id** – 1 - 6
### get_acceleration(id)
Read acceleration during all moves
* **Parameters**
**id** – 1/2/3 (L/R/W)
### get_angle(id, joint_id)
Get the angle of a single joint
* **Parameters**
* **id** (_int_) – 1/2/3 (L/R/W).
* **joint_id** (_int_) – 1 - 7 (7 is gripper)
### get_angles(id)
Get the degree of all joints.
* **Parameters**
**id** – 1/2 (L/R)
* **Returns**
A float list of all degree.
* **Return type**
list
### get_base_coord(id)
Get the base coordinates of the single arm
* **Parameters**
**id** – 1/2 (L/R)
### get_base_coords(\*args: int)
Convert coordinates to base coordinates. Pass in parameters or no parameters
* **Parameters**
* **coords** – a list of coords value(List[float]), length 6 [x(mm), y, z, rx(angle), ry, rz]
* **arm** – 0 - left. 1 - right
* **Returns**
Base coords
### get_coord(id, joint_id)
Read a single coordinate parameter
* **Parameters**
* **id** (_int_) – 1/2/3 (L/R/W).
* **joint_id** (_int_) – 1 - 7 (7 is gripper)
### get_coords(id)
Get the coordinates of the robotic arm
* **Parameters**
**id** – 1/2 (L/R).
### get_digital_input(id, pin_no)
singal value
* **Parameters**
* **id** – 1/2 (L/R)
* **pin_no** (_int_) – 1 - 5
### get_encoder(id, joint_id)
Obtain the specified joint potential value.
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **joint_id** – (int) 1 ~ 6
* **Returns**
0 ~ 4096
### get_encoders(id)
Get the six joints of the manipulator
* **Parameters**
**id** – 1/2 (L/R).
* **Returns**
The list of encoders
### get_end_type(id)
Get end coordinate system
* **Parameters**
**id** – 0/1/2 (ALL/L/R)
* **Returns**
0 - flange
1 - tool
### get_gripper_value(id)
Get the value of gripper.
* **Parameters**
**id** – 1/2 (L/R)
* **Returns**
gripper value (int)
### get_joint_current(id, joint_id)
Get Collision Current
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **joint_id** – 1 - 6
### get_joint_max_angle(id, joint_id)
Gets the maximum movement angle of the specified joint
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **joint_id** – (int) 1 - 6
* **Returns**
angle value(float)
### get_joint_min_angle(id, joint_id)
Gets the minimum movement angle of the specified joint
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **joint_id** – (int) 1 - 6
* **Returns**
angle value(float)
### get_movement_type(id)
Get movement type
* **Parameters**
**id** – 0/1/2 (ALL/L/R)
* **Returns**
1 - movel
0 - moveJ
### get_plan_acceleration(id=0)
Get planning acceleration
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
* **Returns**
[movel planning acceleration, movej planning acceleration].
### get_plan_speed(id=0)
Get planning speed
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
* **Returns**
[movel planning speed, movej planning speed].
### get_reference_frame(id)
Get the base coordinate system
* **Parameters**
**id** – 0/1/2 (ALL/L/R)
* **Returns**
0 - base 1 - tool.
### get_robot_id(id)
Detect this robot id
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### get_robot_version(id)
Get cobot version
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### get_servo_currents(id)
Get joint current
* **Parameters**
**id** – 1/2/3 (L/R/W)
* **Returns**
value mA
### get_servo_data(id, servo_no, data_id)
Read the data parameter of the specified address of the steering gear.
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **servo_no** – Serial number of articulated steering gear, 1 - 6.
* **data_id** – Data address.
* **Returns**
values (0 - 4096)
0 - disable
1 - enable
-1 - error
### get_servo_status(id)
Get joint status
* **Parameters**
**id** – 1/2/3 (L/R/W)
* **Returns**
[voltage, sensor, temperature, current, angle, overload], a value of 0 means no error
### get_servo_spees(id)
Get joint speed
* **Parameters**
**id** – 1/2/ (L/R)
* **Returns**
list len 6
### get_servo_temps(id)
Get joint temperature
* **Parameters**
**id** – 1/2/3 (L/R/W)
### get_servo_voltages(id)
Get joint voltages
* **Parameters**
**id** – 1/2/3 (L/R/W)
* **Returns**
volts < 24 V
### get_speed(id)
Get speed
* **Parameters**
**id** – 1/2/3 (L/R/W).
* **Returns**
speed
* **Return type**
int
### get_system_version(id)
Get cobot version
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### get_tool_reference(id)
Get tool coordinate system
* **Parameters**
**id** – 0/1/2 (ALL/L/R)
### get_world_reference(id)
Get the world coordinate system
* **Parameters**
**id** – 0/1/2 (ALL/L/R)
### is_all_servo_enable(id)
Determine whether the specified steering gear is connected
* **Parameters**
**id** – 1/2/3 (L/R/W)
* **Returns**
0 - disable
1 - enable
-1 - error
### is_collision_on()
Get collision detection status
### is_controller_connected(id=0)
Wether connected with Atom.
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### is_free_mode(id)
Check if it is free mode
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
* **Returns**
0/1
### is_gripper_moving(id)
Judge whether the gripper is moving or not
* **Parameters**
**id** – 1/2 (L/R)
* **Returns**
0 - not moving
1 - is moving
-1 - error data
### is_in_position(id, data, mode)
Judge whether in the position.
* **Parameters**
* **id** – 0/1/2/3 (ALL/L/R/W).
* **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
* **mode** – 1 - coords, 0 - angles
* **Returns**
1 - True
0 - False
-1 - Error
### is_moving(id)
Detect if the robot is moving
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W).
* **Returns**
0 - not moving
1 - is moving
-1 - error data
### is_paused(id)
Judge whether the manipulator pauses or not.
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W).
* **Returns**
1 - paused
0 - not paused
-1 - error
### is_power_on(id=0)
Adjust robot arm status
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
* **Returns**
1 - power on
0 - power off
-1 - error data
### is_servo_enable(id, servo_id)
Determine whether all steering gears are connected
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **servo_id** – (int) 1 ~ 6
* **Returns**
0 - disable
1 - enable
-1 - error
### jog_absolute(id, joint_id, angle, speed)
Absolute joint control
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **joint_id** – int 1-6.
* **angle** – int
* **speed** – int (0 - 100)
### jog_angle(id, joint_id, direction, speed)
Jog control angle.
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **joint_id** – int 1-6.
* **direction** – 0 - decrease, 1 - increase
* **speed** – int (0 - 100)
### jog_coord(id, coord_id, direction, speed)
Jog control coord.
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **coord_id** – int 1-6 (x/y/z/rx/ry/rz).
* **direction** – 0 - decrease, 1 - increase
* **speed** – int (0 - 100)
### jog_inc_coord(axis, increment, speed)
Double-arm coordinated coordinate stepping
* **Parameters**
* **axis** – 1 - 6 (x/y/z/rx/ry/rz)
* **increment** –
* **speed** – 1 - 100
### jog_increment(id, joint_id, increment, speed)
step mode
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **joint_id** – int 1-6.
* **increment** –
* **speed** – int (1 - 100)
### jog_stop(id)
Stop jog moving
* **Parameters**
**id** – 1/2/3 (L/R/W).
### joint_brake(id, joint_id)
Make it stop when the joint is in motion, and the buffer distance is positively related to the existing speed
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **joint_id** – 1 - 6
### pause(id)
Pause movement
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W).
### power_off(id=0)
Close communication with Atom.
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### power_on(id=0)
Open communication with Atom.
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### read_next_error(id=0)
Robot Error Detection
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### release_all_servos(id=0)
Robot turns off torque output
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W)
### release_servo(id, servo_id)
Power off designated servo
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **servo_id** – 1 - 6.
### resume(id)
Recovery movement
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W).
### send_angle(id, joint, angle, speed)
Send one degree of joint to robot arm.
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **joint** – 1 ~ 6
* **angle** – int
* **speed** – 1 ~ 100
### send_angles(id, degrees, speed)
Send all angles to the robotic arm
* **Parameters**
* **id** – 1/2 (L/R).
* **degrees** – [angle_list] len 6
* **speed** – 1 - 100
### send_coord(id, coord, data, speed)
Send a single coordinate to the robotic arm
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **coord** – 1 ~ 6 (x/y/z/rx/ry/rz)
* **data** – Coordinate value
* **speed** – 0 ~ 100
### send_coords(id, coords, speed, mode)
Send all coords to robot arm.
* **Parameters**
* **id** – 1/2 (L/R).
* **coords** – a list of coords value(List[float]), length 6, [x(mm), y, z, rx(angle), ry, rz]
* **speed** – (int) 0 ~ 100
* **mode** – (int) 0 - moveJ, 1 - moveL, 2 - moveC
### set_acceleration(id, acc)
Read acceleration during all moves
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **acc** – 1 - 100
### set_color(id, r=0, g=0, b=0)
Set the light color on the top of the robot arm.
* **Parameters**
* **id** – 1/2 (L/R)
* **r** (_int_) – 0 ~ 255
* **g** (_int_) – 0 ~ 255
* **b** (_int_) – 0 ~ 255
### set_digital_output(id, pin_no, pin_signal)
Set atom IO output level
* **Parameters**
* **id** – 1/2 (L/R)
* **pin_no** (_int_) – 1 - 5
* **pin_signal** (_int_) – 0 / 1
### set_encoder(id, joint_id, encoder, speed)
Set a single joint rotation to the specified potential value.
* **Parameters**
* **id** – 1/2/3 (L/R/W).
* **joint_id** – 1 - 6.
* **encoder** – The value of the set encoder.
### set_encoders(id, encoders, speed)
Set the six joints of the manipulator to execute synchronously to the specified position.
* **Parameters**
* **id** – 1/2 (L/R).
* **encoders** – A encoder list, length 6.
* **speed** – speed 1 ~ 100
### set_end_type(id, end)
Set end coordinate system
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **end** – 0 - flange, 1 - tool
### set_encoders_drag(id, encoders, speeds)
Send all encoders and speeds
- **Parameters**
* **encoders** - (`list`) : encoders list.
* **speeds** - Obtained by the get_servo_speeds() method
### set_free_mode(id, value)
set free mode
* **Parameters**
* **id** – 0/1/2/3 (ALL/L/R/W)
* **value** – 0 - close 1 - open
### set_fresh_mode(id, mode)
Set command refresh mode
* **Parameters**
* **id** – 1/2 (L/R).
* **mode** – int
1 - Always execute the latest command first.
0 - Execute instructions sequentially in the form of a queue.
### set_gripper_calibration(id)
Set the current position to zero, set current position value is 2048.
* **Parameters**
**id** – 1/2 (L/R)
### set_gripper_state(id, flag)
Set gripper switch state
* **Parameters**
* **id** – 1/2 (L/R)
* **flag** (_int_) – 0 - close, 1 - open
### set_gripper_value(id, value, speed)
Set gripper value
* **Parameters**
* **id** – 1/2 (L/R)
* **value** (_int_) – 0 ~ 100
* **speed** (_int_) – 0 ~ 100
### set_joint_current(id, joint_id, current)
Set Collision Current
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **joint_id** – 1 - 6
* **current** – current value
### set_joint_max(id, joint_id, angle)
Set the joint maximum angle
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **joint_id** – int 1-6.
* **angle** – 0 ~ 180
### set_joint_min(id, joint_id, angle)
Set the joint minimum angle
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **joint_id** – int 1-6.
* **angle** – 0 ~ 180
### set_movement_type(id, move_type)
Set movement type
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **move_type** – 1 - movel, 0 - moveJ
### set_pin_mode(id, pin_no, pin_mode)
Set the state mode of the specified pin in atom.
* **Parameters**
* **id** – 1/2 (L/R)
* **pin_no** (_int_) – pin number (1 - 5).
* **pin_mode** (_int_) – 0 - input, 1 - output
### set_plan_acceleration(id, acceleration)
Set planning acceleration
* **Parameters**
* **id** – 0/1/2/3 (ALL/L/R/W)
* **acceleration** (_int_) – (0 ~ 100).
### set_plan_speed(id, speed)
Set planning speed
* **Parameters**
* **id** – 0/1/2/3 (ALL/L/R/W)
* **speed** (_int_) – (0 ~ 100).
### set_pwm_output()
Set PWM output
### set_reference_frame(id, rftype)
Set the base coordinate system
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **rftype** – 0 - base 1 - tool.
### set_robot_id(id, new_id)
Set this robot id
* **Parameters**
* **id** – 0/1/2/3 (ALL/L/R/W)
* **new_id** – 1 - 253
### set_servo_calibration(id, servo_no)
The current position of the calibration joint actuator is the angle zero point,
and the corresponding potential value is 2048.
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **servo_no** – Serial number of articulated steering gear, 1 - 6.
### set_servo_data(id, servo_no, data_id, value)
Set the data parameters of the specified address of the steering gear
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **servo_no** – Serial number of articulated steering gear, 1 - 6.
* **data_id** – Data address.
* **value** – 0 - 4096
### set_speed(id, speed)
Set speed value
* **Parameters**
* **id** – 1/2/3 (L/R/W)
* **speed** (_int_) – 0 - 100
### set_tool_reference(id, coords)
Set tool coordinate system
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **coords** – a list of coords value(List[float]), length 6. [x(mm), y, z, rx(angle), ry, rz]
### set_world_reference(id, coords)
Set the world coordinate system
* **Parameters**
* **id** – 0/1/2 (ALL/L/R)
* **coords** – a list of coords value(List[float]), length 6 [x(mm), y, z, rx(angle), ry, rz]
### stop(id)
Stop moving
* **Parameters**
**id** – 0/1/2/3 (ALL/L/R/W).
### write_base_coord(id, axis, coord, speed)
Base single coordinate movement
* **Parameters**
* **id** – 1/2 (L/R)
* **axis** – 1 - 6 (x/y/z/rx/ry/rz)
* **coord** – Coordinate value
* **speed** – 1 - 100
### write_base_coords(id, coords, speed)
base coordinate move
* **Parameters**
* **id** – 1/2 (L/R)
* **coords** – coords: a list of coords value(List[float]), length 6, [x(mm), y, z, rx(angle), ry, rz]
* **speed** – 1 - 100
### get_radians(id)
Get the radians of all joints
* **Parameters**
**id** – 1/2 (L/R)
* **Returns**
A list of float radians [radian1, …]
* **Return type**
list
### send_radians(id, radians, speed)
Send the radians of all joints to robot arm
* **Parameters**
* **id** – 1/2 (L/R).
* **radians** – a list of radian values( List[float]), length 6
* **speed** – (int )1 ~ 100
### set_gpio_input(pin)
Set GPIO input value.
* **Parameters**
**pin** – (int)pin number.
### set_gpio_mode(pin_no, mode)
Init GPIO module, and set BCM mode.
* **Parameters**
* **pin_no** – (int)pin number.
* **mode** – 0 - input 1 - output
### set_gpio_output(pin, v)
Set GPIO output value.
* **Parameters**
* **pin** – (int)pin number.
* **v** – (int) 0 / 1
### set_gpio_pwm(pin, baud, dc)
Set GPIO PWM value.
* **Parameters**
* **pin** – (int)pin number.
* **baud** – (int) 10 - 1000000
* **dc** – (int) 0 - 100
# MyBuddyEmoticon
## MyBuddyEmoticon(file_path: list = [], window_size: tuple = [], loop=False)
API for playing emoticons
* **Parameters**
* **file_path** - `[[path, time],...]` The absolute path of facial expression video and the length of time to play.Time in seconds.
* **window_size** - `(Length, width) `Size of the playback window (default is full screen).
* **loop** - Loop playback or not (only once by default).
```python
from pymycobot import MyBuddyEmoticon
import time
# playlist
file_path = [
['/home/er/emo/look_happy.mp4', 10],
]
# Initialize the object and set it to loop playback
em = MyBuddyEmoticon(file_path, loop = True)
# Start playing
em.start()
# Pause playback after 3 seconds
# time.sleep(3)
# em.pause()
# Continue playing
# em.run()
# The main thread waits for the completion of playback
em.join()
```
### add_file_path(path_time: list)
Add Playback File
* **Parameters**
**path_time** – [path, time] The video address to be added and the running time
### del_file_path(index: int)
Delete the element with the specified subscript in the playlist list
* **Parameters**
**index** – The subscript of the element in the playlist to be deleted
### file_path
Get Playfile List
* **Returns**
list
### join()
Wait for the thread playing the video to finish
### pause()
Pause playback
### run()
Continue playing
### start()
Start playing
---
More demo can go to [here](../demo).
Raw data
{
"_id": null,
"home_page": "https://github.com/elephantrobotics/pymycobot",
"name": "pymycobot",
"maintainer": null,
"docs_url": null,
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"maintainer_email": null,
"keywords": null,
"author": "Elephantrobotics",
"author_email": "weiquan.xu@elephantrobotics.com",
"download_url": "https://files.pythonhosted.org/packages/01/50/cd5bc6e0a46036c89dc73b2d889e24c4381caeba644e74e3b292436ac717/pymycobot-3.9.1.tar.gz",
"platform": null,
"description": "# This is Python API for ElephantRobotics product\r\n\r\n\r\n\r\n[](https://pypi.org/project/pigit)\r\n\r\nThis is a python API for serial communication with mycobot and controlling it.\r\n\r\n[](https://www.elephantrobotics.com/en/myCobot-en/)\r\n\r\n## Installation\r\n\r\n**Notes**:\r\n\r\n> Make sure that `Atom` is flashed into the top Atom, `Transponder` is flashed into the base Basic. <br>\r\n> The firmware `Atom` and `Transponder` download address: [https://github.com/elephantrobotics/myCobot/tree/main/Software](https://github.com/elephantrobotics/myCobot/tree/main/Software)<br>\r\n> You also can use myStudio to flash them, myStudio address: [https://github.com/elephantrobotics/myStudio/releases](https://github.com/elephantrobotics/myStudio/releases)\r\n\r\n### Pip\r\n\r\n```bash\r\npip install pymycobot --upgrade\r\n```\r\n\r\n<!--\r\n**Notes:**\r\n\r\n> Now only the version is `Atom2.4` or later is supported. If you use an earlier version, please install `pymycobot 1.0.7`.\r\n\r\n```bash\r\npip install pymycobot==1.0.7 --user\r\n```\r\n-->\r\n\r\n### Source code\r\n\r\n```bash\r\ngit clone https://github.com/elephantrobotics/pymycobot.git <your-path>\r\ncd <your-path>/pymycobot\r\n# Install\r\n[sudo] python2 setup.py install\r\n# or\r\n[sudo] python3 setup.py install\r\n```\r\n\r\nOr the more modern form:\r\n\r\n```bash\r\n# Install\r\npip install .\r\n# Uninstall\r\npip uninstall .\r\n```\r\n\r\n## Usage:\r\n\r\n```python\r\n# for mycobot 280 machine\r\nfrom pymycobot import MyCobot280 \r\nfrom pymycobot import MyCobot280Socket\r\n# for mycobot 320 machine\r\nfrom pymycobot import MyCobot320\r\nfrom pymycobot import MyCobot320Socket \r\n# for mecharm 270 machine\r\nfrom pymycobot import MechArm270 \r\nfrom pymycobot import MechArmSocket \r\n# for mypalletizer 260 machine\r\nfrom pymycobot import MyPalletizer260 \r\nfrom pymycobot import MyPalletizerSocket\r\n```\r\n\r\nThe [`demo`](./demo) directory stores some test case files.\r\n\r\nYou can find out which interfaces pymycobot provides in `pymycobot/README.md`.\r\n\r\nPlease go to [here](./docs/README.md).\r\n\r\n\r\n> 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: \r\n\r\n \r\n\r\n[MyCobot 280 API\u8bf4\u660e](./docs/MyCobot_280_zh.md) | [MyCobot 280 API Description](./docs/MyCobot_280_en.md)\r\n\r\n[MyCobot 320 API\u8bf4\u660e](./docs/MyCobot_320_zh.md) | [MyCobot 320 API Description](./docs/MyCobot_320_en.md)\r\n\r\n[MechArm 270 API\u8bf4\u660e](./docs/MechArm_270_zh.md) | [MechArm 270 API Description](./docs/MechArm_270_en.md)\r\n\r\n[MyPalletizer 260 API\u8bf4\u660e](./docs/MyPalletizer_260_zh.md) | [MyPalletizer 260 API Description](./docs/MyPalletizer_260_en.md)\r\n\r\n[myAGV API\u8bf4\u660e](./docs/myAGV_zh.md) | [myAGV API Description](./docs/myAGV_en.md)\r\n\r\n[myArm_M&C API\u8bf4\u660e](./docs/myArm_M&C_zh.md) | [myArm_M&C API Description](./docs/myArm_M&C_en.md)\r\n\r\n[ultraArm P340 API\u8bf4\u660e](./docs/ultraArm_P340_zh.md) | [ultraArm P340 API Description](./docs/ultraArm_P340_en.md)# pymycobot\r\n\r\n**This is python API for ElephantRobotics product**\r\n\r\nWe support Python2, Python3.5 or later.\r\n\r\n \r\n\r\n[MyCobot 280 API\u8bf4\u660e](./MyCobot_280_zh.md) | [MyCobot 280 API Description](./MyCobot_280_en.md)\r\n\r\n[MyCobot 320 API\u8bf4\u660e](./MyCobot_320_zh.md) | [MyCobot 320 API Description](./MyCobot_320_en.md)\r\n\r\n[MechArm 270 API\u8bf4\u660e](./MechArm_270_zh.md) | [MechArm 270 API Description](./MechArm_270_en.md)\r\n\r\n[MyPalletizer 260 API\u8bf4\u660e](./MyPalletizer_260_zh.md) | [MyPalletizer 260 API Description](./MyPalletizer_260_en.md)\r\n\r\n[myAGV API\u8bf4\u660e](./myAGV_zh.md) | [myAGV API Description](./myAGV_en.md)\r\n\r\n[myArm_M&C API\u8bf4\u660e](./myArm_M&C_zh.md) | [myArm_M&C API Description](./myArm_M&C_en.md)\r\n\r\n[ultraArm P340 API\u8bf4\u660e](./ultraArm_P340_zh.md) | [ultraArm P340 API Description](./ultraArm_P340_en.md)\r\n\r\n<details>\r\n<summary>Catalogue:</summary>\r\n\r\n<!-- vim-markdown-toc GFM -->\r\n\r\n- [pymycobot](#pymycobot)\r\n- [MyBuddy](#mybuddy)\r\n - [base\\_to\\_single\\_coords(base\\_coords, arm)](#base_to_single_coordsbase_coords-arm)\r\n - [collision(left\\_angles, right\\_angles)](#collisionleft_angles-right_angles)\r\n - [collision\\_switch(state)](#collision_switchstate)\r\n - [focus\\_servo(id, servo\\_id)](#focus_servoid-servo_id)\r\n - [get\\_acceleration(id)](#get_accelerationid)\r\n - [get\\_angle(id, joint\\_id)](#get_angleid-joint_id)\r\n - [get\\_angles(id)](#get_anglesid)\r\n - [get\\_base\\_coord(id)](#get_base_coordid)\r\n - [get\\_base\\_coords(\\*args: int)](#get_base_coordsargs-int)\r\n - [get\\_coord(id, joint\\_id)](#get_coordid-joint_id)\r\n - [get\\_coords(id)](#get_coordsid)\r\n - [get\\_digital\\_input(id, pin\\_no)](#get_digital_inputid-pin_no)\r\n - [get\\_encoder(id, joint\\_id)](#get_encoderid-joint_id)\r\n - [get\\_encoders(id)](#get_encodersid)\r\n - [get\\_end\\_type(id)](#get_end_typeid)\r\n - [get\\_gripper\\_value(id)](#get_gripper_valueid)\r\n - [get\\_joint\\_current(id, joint\\_id)](#get_joint_currentid-joint_id)\r\n - [get\\_joint\\_max\\_angle(id, joint\\_id)](#get_joint_max_angleid-joint_id)\r\n - [get\\_joint\\_min\\_angle(id, joint\\_id)](#get_joint_min_angleid-joint_id)\r\n - [get\\_movement\\_type(id)](#get_movement_typeid)\r\n - [get\\_plan\\_acceleration(id=0)](#get_plan_accelerationid0)\r\n - [get\\_plan\\_speed(id=0)](#get_plan_speedid0)\r\n - [get\\_reference\\_frame(id)](#get_reference_frameid)\r\n - [get\\_robot\\_id(id)](#get_robot_idid)\r\n - [get\\_robot\\_version(id)](#get_robot_versionid)\r\n - [get\\_servo\\_currents(id)](#get_servo_currentsid)\r\n - [get\\_servo\\_data(id, servo\\_no, data\\_id)](#get_servo_dataid-servo_no-data_id)\r\n - [get\\_servo\\_status(id)](#get_servo_statusid)\r\n - [get\\_servo\\_spees(id)](#get_servo_speesid)\r\n - [get\\_servo\\_temps(id)](#get_servo_tempsid)\r\n - [get\\_servo\\_voltages(id)](#get_servo_voltagesid)\r\n - [get\\_speed(id)](#get_speedid)\r\n - [get\\_system\\_version(id)](#get_system_versionid)\r\n - [get\\_tool\\_reference(id)](#get_tool_referenceid)\r\n - [get\\_world\\_reference(id)](#get_world_referenceid)\r\n - [is\\_all\\_servo\\_enable(id)](#is_all_servo_enableid)\r\n - [is\\_collision\\_on()](#is_collision_on)\r\n - [is\\_controller\\_connected(id=0)](#is_controller_connectedid0)\r\n - [is\\_free\\_mode(id)](#is_free_modeid)\r\n - [is\\_gripper\\_moving(id)](#is_gripper_movingid)\r\n - [is\\_in\\_position(id, data, mode)](#is_in_positionid-data-mode)\r\n - [is\\_moving(id)](#is_movingid)\r\n - [is\\_paused(id)](#is_pausedid)\r\n - [is\\_power\\_on(id=0)](#is_power_onid0)\r\n - [is\\_servo\\_enable(id, servo\\_id)](#is_servo_enableid-servo_id)\r\n - [jog\\_absolute(id, joint\\_id, angle, speed)](#jog_absoluteid-joint_id-angle-speed)\r\n - [jog\\_angle(id, joint\\_id, direction, speed)](#jog_angleid-joint_id-direction-speed)\r\n - [jog\\_coord(id, coord\\_id, direction, speed)](#jog_coordid-coord_id-direction-speed)\r\n - [jog\\_inc\\_coord(axis, increment, speed)](#jog_inc_coordaxis-increment-speed)\r\n - [jog\\_increment(id, joint\\_id, increment, speed)](#jog_incrementid-joint_id-increment-speed)\r\n - [jog\\_stop(id)](#jog_stopid)\r\n - [joint\\_brake(id, joint\\_id)](#joint_brakeid-joint_id)\r\n - [pause(id)](#pauseid)\r\n - [power\\_off(id=0)](#power_offid0)\r\n - [power\\_on(id=0)](#power_onid0)\r\n - [read\\_next\\_error(id=0)](#read_next_errorid0)\r\n - [release\\_all\\_servos(id=0)](#release_all_servosid0)\r\n - [release\\_servo(id, servo\\_id)](#release_servoid-servo_id)\r\n - [resume(id)](#resumeid)\r\n - [send\\_angle(id, joint, angle, speed)](#send_angleid-joint-angle-speed)\r\n - [send\\_angles(id, degrees, speed)](#send_anglesid-degrees-speed)\r\n - [send\\_coord(id, coord, data, speed)](#send_coordid-coord-data-speed)\r\n - [send\\_coords(id, coords, speed, mode)](#send_coordsid-coords-speed-mode)\r\n - [set\\_acceleration(id, acc)](#set_accelerationid-acc)\r\n - [set\\_color(id, r=0, g=0, b=0)](#set_colorid-r0-g0-b0)\r\n - [set\\_digital\\_output(id, pin\\_no, pin\\_signal)](#set_digital_outputid-pin_no-pin_signal)\r\n - [set\\_encoder(id, joint\\_id, encoder, speed)](#set_encoderid-joint_id-encoder-speed)\r\n - [set\\_encoders(id, encoders, speed)](#set_encodersid-encoders-speed)\r\n - [set\\_end\\_type(id, end)](#set_end_typeid-end)\r\n - [set\\_encoders\\_drag(id, encoders, speeds)](#set_encoders_dragid-encoders-speeds)\r\n - [set\\_free\\_mode(id, value)](#set_free_modeid-value)\r\n - [set\\_fresh\\_mode(id, mode)](#set_fresh_modeid-mode)\r\n - [set\\_gripper\\_calibration(id)](#set_gripper_calibrationid)\r\n - [set\\_gripper\\_state(id, flag)](#set_gripper_stateid-flag)\r\n - [set\\_gripper\\_value(id, value, speed)](#set_gripper_valueid-value-speed)\r\n - [set\\_joint\\_current(id, joint\\_id, current)](#set_joint_currentid-joint_id-current)\r\n - [set\\_joint\\_max(id, joint\\_id, angle)](#set_joint_maxid-joint_id-angle)\r\n - [set\\_joint\\_min(id, joint\\_id, angle)](#set_joint_minid-joint_id-angle)\r\n - [set\\_movement\\_type(id, move\\_type)](#set_movement_typeid-move_type)\r\n - [set\\_pin\\_mode(id, pin\\_no, pin\\_mode)](#set_pin_modeid-pin_no-pin_mode)\r\n - [set\\_plan\\_acceleration(id, acceleration)](#set_plan_accelerationid-acceleration)\r\n - [set\\_plan\\_speed(id, speed)](#set_plan_speedid-speed)\r\n - [set\\_pwm\\_output()](#set_pwm_output)\r\n - [set\\_reference\\_frame(id, rftype)](#set_reference_frameid-rftype)\r\n - [set\\_robot\\_id(id, new\\_id)](#set_robot_idid-new_id)\r\n - [set\\_servo\\_calibration(id, servo\\_no)](#set_servo_calibrationid-servo_no)\r\n - [set\\_servo\\_data(id, servo\\_no, data\\_id, value)](#set_servo_dataid-servo_no-data_id-value)\r\n - [set\\_speed(id, speed)](#set_speedid-speed)\r\n - [set\\_tool\\_reference(id, coords)](#set_tool_referenceid-coords)\r\n - [set\\_world\\_reference(id, coords)](#set_world_referenceid-coords)\r\n - [stop(id)](#stopid)\r\n - [write\\_base\\_coord(id, axis, coord, speed)](#write_base_coordid-axis-coord-speed)\r\n - [write\\_base\\_coords(id, coords, speed)](#write_base_coordsid-coords-speed)\r\n - [get\\_radians(id)](#get_radiansid)\r\n - [send\\_radians(id, radians, speed)](#send_radiansid-radians-speed)\r\n - [set\\_gpio\\_input(pin)](#set_gpio_inputpin)\r\n - [set\\_gpio\\_mode(pin\\_no, mode)](#set_gpio_modepin_no-mode)\r\n - [set\\_gpio\\_output(pin, v)](#set_gpio_outputpin-v)\r\n - [set\\_gpio\\_pwm(pin, baud, dc)](#set_gpio_pwmpin-baud-dc)\r\n- [MyBuddyEmoticon](#mybuddyemoticon)\r\n - [MyBuddyEmoticon(file\\_path: list = \\[\\], window\\_size: tuple = \\[\\], loop=False)](#mybuddyemoticonfile_path-list---window_size-tuple---loopfalse)\r\n - [add\\_file\\_path(path\\_time: list)](#add_file_pathpath_time-list)\r\n - [del\\_file\\_path(index: int)](#del_file_pathindex-int)\r\n - [file\\_path](#file_path)\r\n - [join()](#join)\r\n - [pause()](#pause)\r\n - [run()](#run)\r\n - [start()](#start)\r\n \r\n<!-- vim-markdown-toc -->\r\n</details>\r\n\r\n# MyBuddy\r\n\r\n### base_to_single_coords(base_coords, arm)\r\n\r\nConvert base coordinates to coordinates\r\n\r\n* **Parameters**\r\n\r\n * **coords** \u2013 a list of base coords value len 6\r\n\r\n * **arm** \u2013 0 - left. 1 - right\r\n\r\n* **Returns**\r\n\r\n coords\r\n\r\n### collision(left_angles, right_angles)\r\n\r\nCollision detection main program\r\n\r\n* **Parameters**\r\n\r\n * **left_angles** \u2013 left arm angle len 6.\r\n\r\n * **right_angles** \u2013 right arm angle len 6.\r\n\r\n* **Returns**\r\n\r\n int\r\n\r\n### collision_switch(state)\r\n\r\nCollision Detection Switch\r\n\r\n* **Parameters**\r\n\r\n **state** (_int_) \u2013 0 - close 1 - open (Off by default)\r\n\r\n### focus_servo(id, servo_id)\r\n\r\nPower on designated servo\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **servo_id** \u2013 1 - 6\r\n\r\n### get_acceleration(id)\r\n\r\nRead acceleration during all moves\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W)\r\n\r\n### get_angle(id, joint_id)\r\n\r\nGet the angle of a single joint\r\n\r\n* **Parameters**\r\n\r\n * **id** (_int_) \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** (_int_) \u2013 1 - 7 (7 is gripper)\r\n\r\n### get_angles(id)\r\n\r\nGet the degree of all joints.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R)\r\n\r\n* **Returns**\r\n\r\n A float list of all degree.\r\n\r\n* **Return type**\r\n\r\n list\r\n\r\n### get_base_coord(id)\r\n\r\nGet the base coordinates of the single arm\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R)\r\n\r\n### get_base_coords(\\*args: int)\r\n\r\nConvert coordinates to base coordinates. Pass in parameters or no parameters\r\n\r\n* **Parameters**\r\n\r\n * **coords** \u2013 a list of coords value(List[float]), length 6 [x(mm), y, z, rx(angle), ry, rz]\r\n\r\n * **arm** \u2013 0 - left. 1 - right\r\n\r\n* **Returns**\r\n\r\n Base coords\r\n\r\n### get_coord(id, joint_id)\r\n\r\nRead a single coordinate parameter\r\n\r\n* **Parameters**\r\n\r\n * **id** (_int_) \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** (_int_) \u2013 1 - 7 (7 is gripper)\r\n\r\n### get_coords(id)\r\n\r\nGet the coordinates of the robotic arm\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R).\r\n\r\n### get_digital_input(id, pin_no)\r\n\r\nsingal value\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **pin_no** (_int_) \u2013 1 - 5\r\n\r\n### get_encoder(id, joint_id)\r\n\r\nObtain the specified joint potential value.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** \u2013 (int) 1 ~ 6\r\n\r\n* **Returns**\r\n\r\n 0 ~ 4096\r\n\r\n### get_encoders(id)\r\n\r\nGet the six joints of the manipulator\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R).\r\n\r\n* **Returns**\r\n\r\n The list of encoders\r\n\r\n### get_end_type(id)\r\n\r\nGet end coordinate system\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n* **Returns**\r\n\r\n 0 - flange\r\n 1 - tool\r\n\r\n### get_gripper_value(id)\r\n\r\nGet the value of gripper.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R)\r\n\r\n* **Returns**\r\n\r\n gripper value (int)\r\n\r\n### get_joint_current(id, joint_id)\r\n\r\nGet Collision Current\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **joint_id** \u2013 1 - 6\r\n\r\n### get_joint_max_angle(id, joint_id)\r\n\r\nGets the maximum movement angle of the specified joint\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **joint_id** \u2013 (int) 1 - 6\r\n\r\n* **Returns**\r\n\r\n angle value(float)\r\n\r\n### get_joint_min_angle(id, joint_id)\r\n\r\nGets the minimum movement angle of the specified joint\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **joint_id** \u2013 (int) 1 - 6\r\n\r\n* **Returns**\r\n\r\n angle value(float)\r\n\r\n### get_movement_type(id)\r\n\r\nGet movement type\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n* **Returns**\r\n\r\n 1 - movel\r\n 0 - moveJ\r\n\r\n### get_plan_acceleration(id=0)\r\n\r\nGet planning acceleration\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n* **Returns**\r\n\r\n [movel planning acceleration, movej planning acceleration].\r\n\r\n### get_plan_speed(id=0)\r\n\r\nGet planning speed\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n* **Returns**\r\n\r\n [movel planning speed, movej planning speed].\r\n\r\n### get_reference_frame(id)\r\n\r\nGet the base coordinate system\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n* **Returns**\r\n\r\n 0 - base 1 - tool.\r\n\r\n### get_robot_id(id)\r\n\r\nDetect this robot id\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### get_robot_version(id)\r\n\r\nGet cobot version\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### get_servo_currents(id)\r\n\r\nGet joint current\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W)\r\n\r\n* **Returns**\r\n\r\n value mA\r\n\r\n### get_servo_data(id, servo_no, data_id)\r\n\r\nRead the data parameter of the specified address of the steering gear.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **servo_no** \u2013 Serial number of articulated steering gear, 1 - 6.\r\n\r\n * **data_id** \u2013 Data address.\r\n\r\n* **Returns**\r\n\r\n values (0 - 4096)\r\n 0 - disable\r\n 1 - enable\r\n -1 - error\r\n\r\n### get_servo_status(id)\r\n\r\nGet joint status\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W)\r\n\r\n* **Returns**\r\n\r\n [voltage, sensor, temperature, current, angle, overload], a value of 0 means no error\r\n\r\n### get_servo_spees(id)\r\n\r\nGet joint speed\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/ (L/R)\r\n\r\n* **Returns**\r\n\r\n list len 6\r\n\r\n### get_servo_temps(id)\r\n\r\nGet joint temperature\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W)\r\n\r\n### get_servo_voltages(id)\r\n\r\nGet joint voltages\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W)\r\n\r\n* **Returns**\r\n\r\n volts < 24 V\r\n\r\n### get_speed(id)\r\n\r\nGet speed\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W).\r\n\r\n* **Returns**\r\n\r\n speed\r\n\r\n* **Return type**\r\n\r\n int\r\n\r\n### get_system_version(id)\r\n\r\nGet cobot version\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### get_tool_reference(id)\r\n\r\nGet tool coordinate system\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n### get_world_reference(id)\r\n\r\nGet the world coordinate system\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n### is_all_servo_enable(id)\r\n\r\nDetermine whether the specified steering gear is connected\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W)\r\n\r\n* **Returns**\r\n\r\n 0 - disable\r\n 1 - enable\r\n -1 - error\r\n\r\n### is_collision_on()\r\n\r\nGet collision detection status\r\n\r\n### is_controller_connected(id=0)\r\n\r\nWether connected with Atom.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### is_free_mode(id)\r\n\r\nCheck if it is free mode\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n* **Returns**\r\n\r\n 0/1\r\n\r\n### is_gripper_moving(id)\r\n\r\nJudge whether the gripper is moving or not\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R)\r\n\r\n* **Returns**\r\n\r\n 0 - not moving\r\n 1 - is moving\r\n -1 - error data\r\n\r\n### is_in_position(id, data, mode)\r\n\r\nJudge whether in the position.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2/3 (ALL/L/R/W).\r\n\r\n * **data** \u2013 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\r\n\r\n * **mode** \u2013 1 - coords, 0 - angles\r\n\r\n* **Returns**\r\n\r\n 1 - True\r\n 0 - False\r\n -1 - Error\r\n\r\n### is_moving(id)\r\n\r\nDetect if the robot is moving\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W).\r\n\r\n* **Returns**\r\n\r\n 0 - not moving\r\n 1 - is moving\r\n -1 - error data\r\n\r\n### is_paused(id)\r\n\r\nJudge whether the manipulator pauses or not.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W).\r\n\r\n* **Returns**\r\n\r\n 1 - paused\r\n 0 - not paused\r\n -1 - error\r\n\r\n### is_power_on(id=0)\r\n\r\nAdjust robot arm status\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n* **Returns**\r\n\r\n 1 - power on\r\n 0 - power off\r\n -1 - error data\r\n\r\n### is_servo_enable(id, servo_id)\r\n\r\nDetermine whether all steering gears are connected\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **servo_id** \u2013 (int) 1 ~ 6\r\n\r\n* **Returns**\r\n\r\n 0 - disable\r\n 1 - enable\r\n -1 - error\r\n\r\n### jog_absolute(id, joint_id, angle, speed)\r\n\r\nAbsolute joint control\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** \u2013 int 1-6.\r\n\r\n * **angle** \u2013 int\r\n\r\n * **speed** \u2013 int (0 - 100)\r\n\r\n### jog_angle(id, joint_id, direction, speed)\r\n\r\nJog control angle.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** \u2013 int 1-6.\r\n\r\n * **direction** \u2013 0 - decrease, 1 - increase\r\n\r\n * **speed** \u2013 int (0 - 100)\r\n\r\n### jog_coord(id, coord_id, direction, speed)\r\n\r\nJog control coord.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **coord_id** \u2013 int 1-6 (x/y/z/rx/ry/rz).\r\n\r\n * **direction** \u2013 0 - decrease, 1 - increase\r\n\r\n * **speed** \u2013 int (0 - 100)\r\n\r\n### jog_inc_coord(axis, increment, speed)\r\n\r\nDouble-arm coordinated coordinate stepping\r\n\r\n* **Parameters**\r\n\r\n * **axis** \u2013 1 - 6 (x/y/z/rx/ry/rz)\r\n\r\n * **increment** \u2013\r\n\r\n * **speed** \u2013 1 - 100\r\n\r\n### jog_increment(id, joint_id, increment, speed)\r\n\r\nstep mode\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** \u2013 int 1-6.\r\n\r\n * **increment** \u2013\r\n\r\n * **speed** \u2013 int (1 - 100)\r\n\r\n### jog_stop(id)\r\n\r\nStop jog moving\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2/3 (L/R/W).\r\n\r\n### joint_brake(id, joint_id)\r\n\r\nMake it stop when the joint is in motion, and the buffer distance is positively related to the existing speed\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **joint_id** \u2013 1 - 6\r\n\r\n### pause(id)\r\n\r\nPause movement\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W).\r\n\r\n### power_off(id=0)\r\n\r\nClose communication with Atom.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### power_on(id=0)\r\n\r\nOpen communication with Atom.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### read_next_error(id=0)\r\n\r\nRobot Error Detection\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### release_all_servos(id=0)\r\n\r\nRobot turns off torque output\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n### release_servo(id, servo_id)\r\n\r\nPower off designated servo\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **servo_id** \u2013 1 - 6.\r\n\r\n### resume(id)\r\n\r\nRecovery movement\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W).\r\n\r\n### send_angle(id, joint, angle, speed)\r\n\r\nSend one degree of joint to robot arm.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **joint** \u2013 1 ~ 6\r\n\r\n * **angle** \u2013 int\r\n\r\n * **speed** \u2013 1 ~ 100\r\n\r\n### send_angles(id, degrees, speed)\r\n\r\nSend all angles to the robotic arm\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R).\r\n\r\n * **degrees** \u2013 [angle_list] len 6\r\n\r\n * **speed** \u2013 1 - 100\r\n\r\n### send_coord(id, coord, data, speed)\r\n\r\nSend a single coordinate to the robotic arm\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **coord** \u2013 1 ~ 6 (x/y/z/rx/ry/rz)\r\n\r\n * **data** \u2013 Coordinate value\r\n\r\n * **speed** \u2013 0 ~ 100\r\n\r\n### send_coords(id, coords, speed, mode)\r\n\r\nSend all coords to robot arm.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R).\r\n\r\n * **coords** \u2013 a list of coords value(List[float]), length 6, [x(mm), y, z, rx(angle), ry, rz]\r\n\r\n * **speed** \u2013 (int) 0 ~ 100\r\n\r\n * **mode** \u2013 (int) 0 - moveJ, 1 - moveL, 2 - moveC\r\n\r\n### set_acceleration(id, acc)\r\n\r\nRead acceleration during all moves\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **acc** \u2013 1 - 100\r\n\r\n### set_color(id, r=0, g=0, b=0)\r\n\r\nSet the light color on the top of the robot arm.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **r** (_int_) \u2013 0 ~ 255\r\n\r\n * **g** (_int_) \u2013 0 ~ 255\r\n\r\n * **b** (_int_) \u2013 0 ~ 255\r\n\r\n### set_digital_output(id, pin_no, pin_signal)\r\n\r\nSet atom IO output level\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **pin_no** (_int_) \u2013 1 - 5\r\n\r\n * **pin_signal** (_int_) \u2013 0 / 1\r\n\r\n### set_encoder(id, joint_id, encoder, speed)\r\n\r\nSet a single joint rotation to the specified potential value.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W).\r\n\r\n * **joint_id** \u2013 1 - 6.\r\n\r\n * **encoder** \u2013 The value of the set encoder.\r\n\r\n### set_encoders(id, encoders, speed)\r\n\r\nSet the six joints of the manipulator to execute synchronously to the specified position.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R).\r\n\r\n * **encoders** \u2013 A encoder list, length 6.\r\n\r\n * **speed** \u2013 speed 1 ~ 100\r\n\r\n### set_end_type(id, end)\r\n\r\nSet end coordinate system\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **end** \u2013 0 - flange, 1 - tool\r\n\r\n### set_encoders_drag(id, encoders, speeds)\r\n\r\nSend all encoders and speeds\r\n\r\n- **Parameters**\r\n\r\n * **encoders** - (`list`) : encoders list.\r\n * **speeds** - Obtained by the get_servo_speeds() method\r\n\r\n### set_free_mode(id, value)\r\n\r\nset free mode\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n * **value** \u2013 0 - close 1 - open\r\n\r\n### set_fresh_mode(id, mode)\r\n\r\nSet command refresh mode\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R).\r\n\r\n * **mode** \u2013 int\r\n 1 - Always execute the latest command first.\r\n 0 - Execute instructions sequentially in the form of a queue.\r\n\r\n### set_gripper_calibration(id)\r\n\r\nSet the current position to zero, set current position value is 2048.\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R)\r\n\r\n### set_gripper_state(id, flag)\r\n\r\nSet gripper switch state\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **flag** (_int_) \u2013 0 - close, 1 - open\r\n\r\n### set_gripper_value(id, value, speed)\r\n\r\nSet gripper value\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **value** (_int_) \u2013 0 ~ 100\r\n\r\n * **speed** (_int_) \u2013 0 ~ 100\r\n\r\n### set_joint_current(id, joint_id, current)\r\n\r\nSet Collision Current\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **joint_id** \u2013 1 - 6\r\n\r\n * **current** \u2013 current value\r\n\r\n### set_joint_max(id, joint_id, angle)\r\n\r\nSet the joint maximum angle\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **joint_id** \u2013 int 1-6.\r\n\r\n * **angle** \u2013 0 ~ 180\r\n\r\n### set_joint_min(id, joint_id, angle)\r\n\r\nSet the joint minimum angle\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **joint_id** \u2013 int 1-6.\r\n\r\n * **angle** \u2013 0 ~ 180\r\n\r\n### set_movement_type(id, move_type)\r\n\r\nSet movement type\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **move_type** \u2013 1 - movel, 0 - moveJ\r\n\r\n### set_pin_mode(id, pin_no, pin_mode)\r\n\r\nSet the state mode of the specified pin in atom.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **pin_no** (_int_) \u2013 pin number (1 - 5).\r\n\r\n * **pin_mode** (_int_) \u2013 0 - input, 1 - output\r\n\r\n### set_plan_acceleration(id, acceleration)\r\n\r\nSet planning acceleration\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n * **acceleration** (_int_) \u2013 (0 ~ 100).\r\n\r\n### set_plan_speed(id, speed)\r\n\r\nSet planning speed\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n * **speed** (_int_) \u2013 (0 ~ 100).\r\n\r\n### set_pwm_output()\r\n\r\nSet PWM output\r\n\r\n### set_reference_frame(id, rftype)\r\n\r\nSet the base coordinate system\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **rftype** \u2013 0 - base 1 - tool.\r\n\r\n### set_robot_id(id, new_id)\r\n\r\nSet this robot id\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2/3 (ALL/L/R/W)\r\n\r\n * **new_id** \u2013 1 - 253\r\n\r\n### set_servo_calibration(id, servo_no)\r\n\r\nThe current position of the calibration joint actuator is the angle zero point,\r\n\r\n and the corresponding potential value is 2048.\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **servo_no** \u2013 Serial number of articulated steering gear, 1 - 6.\r\n\r\n### set_servo_data(id, servo_no, data_id, value)\r\n\r\nSet the data parameters of the specified address of the steering gear\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **servo_no** \u2013 Serial number of articulated steering gear, 1 - 6.\r\n\r\n * **data_id** \u2013 Data address.\r\n\r\n * **value** \u2013 0 - 4096\r\n\r\n### set_speed(id, speed)\r\n\r\nSet speed value\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2/3 (L/R/W)\r\n\r\n * **speed** (_int_) \u2013 0 - 100\r\n\r\n### set_tool_reference(id, coords)\r\n\r\nSet tool coordinate system\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **coords** \u2013 a list of coords value(List[float]), length 6. [x(mm), y, z, rx(angle), ry, rz]\r\n\r\n### set_world_reference(id, coords)\r\n\r\nSet the world coordinate system\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 0/1/2 (ALL/L/R)\r\n\r\n * **coords** \u2013 a list of coords value(List[float]), length 6 [x(mm), y, z, rx(angle), ry, rz]\r\n\r\n### stop(id)\r\n\r\nStop moving\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 0/1/2/3 (ALL/L/R/W).\r\n\r\n### write_base_coord(id, axis, coord, speed)\r\n\r\nBase single coordinate movement\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **axis** \u2013 1 - 6 (x/y/z/rx/ry/rz)\r\n\r\n * **coord** \u2013 Coordinate value\r\n\r\n * **speed** \u2013 1 - 100\r\n\r\n### write_base_coords(id, coords, speed)\r\n\r\nbase coordinate move\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R)\r\n\r\n * **coords** \u2013 coords: a list of coords value(List[float]), length 6, [x(mm), y, z, rx(angle), ry, rz]\r\n\r\n * **speed** \u2013 1 - 100\r\n\r\n\r\n\r\n### get_radians(id)\r\n\r\nGet the radians of all joints\r\n\r\n* **Parameters**\r\n\r\n **id** \u2013 1/2 (L/R)\r\n\r\n* **Returns**\r\n\r\n A list of float radians [radian1, \u2026]\r\n\r\n* **Return type**\r\n\r\n list\r\n\r\n### send_radians(id, radians, speed)\r\n\r\nSend the radians of all joints to robot arm\r\n\r\n* **Parameters**\r\n\r\n * **id** \u2013 1/2 (L/R).\r\n\r\n * **radians** \u2013 a list of radian values( List[float]), length 6\r\n\r\n * **speed** \u2013 (int )1 ~ 100\r\n\r\n### set_gpio_input(pin)\r\n\r\nSet GPIO input value.\r\n\r\n* **Parameters**\r\n\r\n **pin** \u2013 (int)pin number.\r\n\r\n### set_gpio_mode(pin_no, mode)\r\n\r\nInit GPIO module, and set BCM mode.\r\n\r\n* **Parameters**\r\n\r\n * **pin_no** \u2013 (int)pin number.\r\n\r\n * **mode** \u2013 0 - input 1 - output\r\n\r\n### set_gpio_output(pin, v)\r\n\r\nSet GPIO output value.\r\n\r\n* **Parameters**\r\n\r\n * **pin** \u2013 (int)pin number.\r\n\r\n * **v** \u2013 (int) 0 / 1\r\n\r\n### set_gpio_pwm(pin, baud, dc)\r\n\r\nSet GPIO PWM value.\r\n\r\n* **Parameters**\r\n\r\n * **pin** \u2013 (int)pin number.\r\n\r\n * **baud** \u2013 (int) 10 - 1000000\r\n\r\n * **dc** \u2013 (int) 0 - 100\r\n\r\n\r\n# MyBuddyEmoticon\r\n\r\n## MyBuddyEmoticon(file_path: list = [], window_size: tuple = [], loop=False)\r\n\r\nAPI for playing emoticons\r\n\r\n* **Parameters**\r\n * **file_path** - `[[path, time],...]` The absolute path of facial expression video and the length of time to play.Time in seconds.\r\n\r\n * **window_size** - `(Length, width) `Size of the playback window (default is full screen).\r\n\r\n * **loop** - Loop playback or not (only once by default).\r\n\r\n```python\r\nfrom pymycobot import MyBuddyEmoticon\r\nimport time\r\n\r\n# playlist\r\nfile_path = [\r\n ['/home/er/emo/look_happy.mp4', 10],\r\n]\r\n# Initialize the object and set it to loop playback\r\nem = MyBuddyEmoticon(file_path, loop = True)\r\n# Start playing\r\nem.start()\r\n\r\n# Pause playback after 3 seconds\r\n# time.sleep(3)\r\n# em.pause()\r\n\r\n# Continue playing\r\n# em.run()\r\n\r\n# The main thread waits for the completion of playback\r\nem.join()\r\n```\r\n\r\n### add_file_path(path_time: list)\r\nAdd Playback File\r\n\r\n\r\n* **Parameters**\r\n\r\n **path_time** \u2013 [path, time] The video address to be added and the running time\r\n\r\n\r\n\r\n### del_file_path(index: int)\r\nDelete the element with the specified subscript in the playlist list\r\n\r\n\r\n* **Parameters**\r\n\r\n **index** \u2013 The subscript of the element in the playlist to be deleted\r\n\r\n\r\n\r\n### file_path\r\nGet Playfile List\r\n\r\n\r\n* **Returns**\r\n\r\n list\r\n\r\n\r\n\r\n### join()\r\nWait for the thread playing the video to finish\r\n\r\n\r\n### pause()\r\nPause playback\r\n\r\n### run()\r\nContinue playing\r\n\r\n\r\n### start()\r\nStart playing\r\n\r\n---\r\nMore demo can go to [here](../demo).\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Python API for serial communication of MyCobot.",
"version": "3.9.1",
"project_urls": {
"Homepage": "https://github.com/elephantrobotics/pymycobot"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1c60a00e3905b780703bc1cfc1ab22fe4b482dcdcf9e5758899cc440f860436a",
"md5": "b9650bd47d95032298f224b68a7825ad",
"sha256": "195c9ffffca09f0f6fb863d856fea7d9cf0f03e49d7310cb9544078c87430eb0"
},
"downloads": -1,
"filename": "pymycobot-3.9.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b9650bd47d95032298f224b68a7825ad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"size": 251793,
"upload_time": "2025-03-04T07:37:22",
"upload_time_iso_8601": "2025-03-04T07:37:22.689987Z",
"url": "https://files.pythonhosted.org/packages/1c/60/a00e3905b780703bc1cfc1ab22fe4b482dcdcf9e5758899cc440f860436a/pymycobot-3.9.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0150cd5bc6e0a46036c89dc73b2d889e24c4381caeba644e74e3b292436ac717",
"md5": "bf0ff92bd08fdc04c8c3a4feab341379",
"sha256": "4c72840b6e7048a0914c8d34dfb765f0047279d97ec48d7d158014fe24c0a270"
},
"downloads": -1,
"filename": "pymycobot-3.9.1.tar.gz",
"has_sig": false,
"md5_digest": "bf0ff92bd08fdc04c8c3a4feab341379",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"size": 185857,
"upload_time": "2025-03-04T07:37:28",
"upload_time_iso_8601": "2025-03-04T07:37:28.022039Z",
"url": "https://files.pythonhosted.org/packages/01/50/cd5bc6e0a46036c89dc73b2d889e24c4381caeba644e74e3b292436ac717/pymycobot-3.9.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-04 07:37:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "elephantrobotics",
"github_project": "pymycobot",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pyserial",
"specs": []
},
{
"name": "python-can",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "flake8",
"specs": []
},
{
"name": "opencv-python",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "crc",
"specs": []
}
],
"lcname": "pymycobot"
}