[toc]
API (Application Programming Interface), also known as Application Programming Interface functions, are predefined functions. When using the following Description interfaces, please import our API library at the beginning by entering the following code, otherwise it will not run successfully:
# Example
from pymycobot import MyArmM
mam = MyArmM('/dev/ttyAMA1')
# Gets the current angle of all joints
angles = mam.get_joints_angle()
print(angles)
# Set 1 joint to move to 40 and speed to 20
mam.set_joint_angle(1, 40, 20)
This interface is shared by
MyArmM
andMyArmC
-
Description: Get the bot correction version number
-
Returns:
- version (int): the bot correction version number
-
Description: Obtaining the Robot Firmware Version (Major and Minor Versions)
-
Returns:
- version (int): the robot firmware
- Description: Get the remediation version of the bot tool
- Description: Get the Robot Tool Firmware Version (End Atom)
-
Description: Set Error Detection Status You can turn off error detection, but do not turn it off unless necessary
-
Parameters:
- status (int): 1 open; o close
- Description: Read error detection status
-
Description: Get the bot error status
-
Returns:
-
No error: [0,0,0,0,0,0,0,0]
-
assuming that error 1 and 3 are reported in section 1, it should return: [[1,3],0,0,0,0,0,0,0]
-
-
Description: Get the robot power status
-
Returns:
- power_status (int): 0: power off, 1: power on
-
Description: Set the robot to power on
- Returns: (int) 1
-
Description: Set the robot to power off
- Returns: (int) 1
- Description: Clear the robot abnormality Ignore the error joint and continue to move
- Description: Set the total length of the receiving command queue
- Description: The total length of the read command queue, the default length is 100
- Description: Clear the queue for receiving commands
- Description: The current length of the read receive queue
-
Description: Gets the current angle of the specified joint
-
Parameters:
- joint_id (int): 0 - 254
-
Description: Gets the current angle of all joints
-
Returns:
- angles list(int): 0 - 254
- Description: Read the maximum angle of all joints
- Description: Read the minimum angle of all joints
-
Description: Sets the zero position of the specified servo motor
-
Parameters:
- servo_id (int): 0 - 254
-
Description: Gets the current encoder potential value for the specified servo motor
-
Parameters:
- servo_id (int): 0 - 254
-
Returns:
- encoder (int): 0-4095
- Description: Obtain the current encoder potential values for multiple servo motors
- Description: Gets the current movement speed of multiple servo motors
-
Description: Get the connection status of multiple servo motors
-
Returns:
- status: list[int*8] 0: The connection failed 1: The connection is successful
- Description: Obtain the temperature of multiple servo motors
- Description: Get the voltage of multiple servo motors
- Description: Obtain the current of multiple servo motors
- Description: Get all the statuses of multiple servo motors
- Description: Obtain multiple servo motor protection currents
-
Description: Set the servo motor torque switch
-
Parameters:
-
joint_id (int): 0-254 254-all
-
state: 0/1
- 1: focus
- 0: release
-
-
Description: Sets the proportionality factor of the position loop P of the specified servo motor
-
Parameters:
-
servo_id (int): 0-254
-
data (int): 0-254
-
-
Description: Reads the position loop P scale factor of the specified servo motor
-
Parameters:
- servo_id (int): 0-254
-
Description: Set the proportional factor of the position ring I of the specified servo motor
-
Parameters:
-
servo_id (int): 0 - 254
-
data (int): 0 - 254
-
- Description: Reads the position loop I scale factor of the specified servo motor
-
Description: Sets the proportional factor for the position ring D of the specified servo motor
-
Parameters:
-
servo_id (int): 0-254
-
data (int): 0-254
-
-
Description: Reads the position ring D scale factor for the specified servo motor
-
Parameters:
- servo_id (int): 0-254
-
Description: Sets the clockwise insensitivity zone of the encoder for the specified servo motor
-
Parameters:
-
servo_id (int): 0 - 254
-
data (int): 0 - 32
-
-
Description: Reads the clockwise insensitive area of the encoder for the specified servo motor
-
Parameters:
- servo_id (int): 0 - 254
-
Description: Sets the counterclockwise insensitive zone of the encoder for the specified servo motor
-
Parameters:
-
servo_id (int): 0 - 254
-
data (int): 0 - 32
-
-
Description: Reads the counterclockwise insensitive area of the encoder of the specified servo motor
-
Parameters:
- servo_id (int): 0 - 254
-
Description: Set the system parameters for the specified servo motor
-
Parameters:
-
servo_id (int): 0 - 254:
-
addr (int):
-
data (int): 0 - 4096
-
mode (int): 1 - data 1byte. 2 - data 2byte
-
-
Description: Read the system parameters of the specified servo motor
-
Parameters:
-
servo_id (int): 0 - 254
-
addr (int):
-
mode (int): 1 - data 1byte. 2 - data 2byte
-
-
Description: Set the host I/O pin status
-
Parameters:
-
io_number: 1 - 2
-
status: 0/1; 0: low; 1: high. default: 1
-
-
Description: get the host I/O pin status
-
Parameters:
- io_number (int): 1 - 2
-
Returns:
- 0 or 1. 1: high 0: low
-
Description: Set the Atom pin status
-
Parameters:
-
io_number (int): 1 - 2
-
status: 0 or 1; 0: low; 1: high. default: 1
-
-
Description: Get the Atom pin status
-
Parameters:
- io_number (int): pin number
-
Returns:
- 0 or 1. 1: high 0: low
-
Description: Set the Atom LED color
-
Parameters:
-
r: 0-255
-
g: 0-255
-
b: 0-255
-
-
Description: read the atom press status
-
Returns:
- int: 0 or 1. 1: press
Only
MyArmM
interfaces are available
-
Description: Sets the individual joints to move to the target angle
-
Parameters:
-
joint_id (int) : 0 - 254
-
angle (int) : 0 - 254
-
speed (int) : 1 - 100
-
-
Description: Sets all joints to move to the target angle
-
Parameters:
-
angles (list[int]): 0 - 254
-
speed (int): 0 - 100
-
-
Description: See if the robot is moving
-
Returns:
-
1: moving
-
0: not moving
-
- Description: The robot stops moving
-
Description: Sets the individual motor motion to the target encoder potential value
-
Parameters:
-
servo_id: (int) 0 - 254
-
encoder: (int) 0 - 4095
-
speed: (int) 1 - 100
-
-
Description: Set the encoder potential value for multiple motors moving to the target
-
Parameters:
-
positions (list[int * 8]): 0 - 4095:
-
speed (int): 1 - 100:
-
- Description: Set multiple servo motors with a specified speed to the target encoder potential value
-
Description: Get the auxiliary pin status
-
Parameters:
- io_number (int): 1 - 6
-
Returns:
- 0 or 1. 1: high 0: low
-
Description: Set the auxiliary pin status
-
Parameters:
-
io_number: 1 - 6
-
status: 0/1; 0: low; 1: high. default: 1
-