class DobotApi(threading.Thread): (source)
Constructor: DobotApi(dobot_connection, verbose)
Initializes the Dobot API for communication and control of a Dobot robot arm. It manages the serial connection, command locking, and provides methods for various robot operations.
Method | __del__ |
Destructor that ensures the connection is closed when the object is deleted. |
Method | __init__ |
Constructor for the DobotApi class. |
Method | clear |
Clears all alarm states of the Dobot. Immediate command. Protocol ID: 20 (rw=1). (Note: PDF Table 29 shows ID 21 for Clear, assuming ID 20 with rw=1) |
Method | close |
Closes the serial connection to the Dobot and releases the lock. |
Method | get |
Gets the current active alarms of the Dobot. Immediate command. Protocol ID: 20. |
Method | get |
Gets static error for angle sensors. Immediate command. Protocol ID: 140. |
Method | get |
Gets parameters for ARC movements. Immediate command. Protocol ID: 100. |
Method | get |
Gets automatic leveling result/status. Immediate command. Protocol ID: 32. |
Method | get |
Gets readings (R, G, B) from the color sensor. Immediate command. Protocol ID: 137. |
Method | get |
Gets parameters for CP movements. Immediate command. Protocol ID: 90. |
Method | get |
Gets the device ID. Immediate command. Protocol uses ID 4 (enum GET_DEVICE_ID) in some docs, but typically distinct from GetDeviceTime. Relies on CommunicationProtocolIDs.GET_DEVICE_ID being correct. [Similar to cite: 336 context]... |
Method | get |
Gets the device name. Immediate command. Protocol ID: 1. |
Method | get |
Gets device's rail capability status. Immediate command. Protocol ID: 3. |
Method | get |
Gets the device serial number. Immediate command. Protocol ID: 0. |
Method | get |
Gets the device's internal time (system tick). Immediate command. Protocol ID: 4. |
Method | get |
Gets the device firmware version. Immediate command. Protocol ID: 2. |
Method | get |
Gets status of the gripper. Immediate command. Protocol ID: 63. |
Method | get |
Gets status of the laser end effector. Immediate command. Protocol ID: 61. |
Method | get |
Gets parameters (bias) for the end effector. Immediate command. Protocol ID: 60. |
Method | get |
Gets status of the suction cup. Immediate command. Protocol ID: 62. |
Method | get |
Gets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40. |
Method | get |
Gets current Hand Hold Teaching trigger output value. Immediate command. Protocol ID: 42. |
Method | get |
Checks if Hand Hold Teaching trigger output is enabled. Immediate command. Protocol ID: 41. |
Method | get |
Gets homing parameters. Immediate command. Protocol ID: 30. |
Method | get |
Gets ADC value for an I/O. Immediate command. Protocol ID: 134. Note: GetIOADC command takes no address param; response contains address and value. |
Method | get |
Gets digital input (DI) status for an I/O. Immediate command. Protocol ID: 133. Note: GetIODI command takes no address param; response contains address and level. |
Method | get |
Gets digital output (DO) status for an I/O. Immediate command. Protocol ID: 131. Note: GetIODO command takes no address param; response contains address and level. |
Method | get |
Gets I/O multiplexing configuration. Immediate command. Protocol ID: 130. Note: Protocol implies getting config for an address, but Get command takes no address. |
Method | get |
Gets PWM output status for an I/O. Immediate command. Protocol ID: 132. Note: GetIOPWM command takes no address param; response contains address and PWM config. |
Method | get |
Gets the status of the IR switch. Immediate command. Protocol ID: 138. |
Method | get |
Gets common JOG parameters. Immediate command. Protocol ID: 72. |
Method | get |
Gets parameters for coordinate mode JOG movements. Immediate command. Protocol ID: 71. |
Method | get |
Gets parameters for joint mode JOG movements. Immediate command. Protocol ID: 70. |
Method | get |
Gets parameters for JOGL (linear jog) mode. Immediate command. Protocol ID: 74. |
Method | get |
Gets the real-time pose (position and joint angles) of the Dobot. |
Method | get |
Gets the rail pose (position of sliding rail). Immediate command. Protocol ID: 13. |
Method | get |
Gets PTP common parameters. Immediate command. Protocol ID: 83. |
Method | get |
Gets PTP coordinate parameters. Immediate command. Protocol ID: 81. |
Method | get |
Gets PTP joint parameters. Immediate command. Protocol ID: 80. |
Method | get |
Gets extended jump parameters for PTP movements. Immediate command. Protocol ID: 87. |
Method | get |
Gets PTP jump parameters. Immediate command. Protocol ID: 82. |
Method | get |
Gets parameters for PTPL mode. Immediate command. Protocol ID: 85. |
Method | get |
Retrieves the current index of the command being executed in the queue. The Dobot protocol specifies this index is a 64-bit unsigned integer. |
Method | get |
Gets Wi-Fi configuration mode status. Immediate command. Protocol ID: 150. |
Method | get |
Gets Wi-Fi connection status. Immediate command. Protocol ID: 157. |
Method | get |
Gets Wi-Fi DNS settings. Immediate command. Protocol ID: 156. |
Method | get |
Gets Wi-Fi gateway settings. Immediate command. Protocol ID: 155. |
Method | get |
Gets Wi-Fi IP address settings. Immediate command. Protocol ID: 153. |
Method | get |
Gets Wi-Fi netmask settings. Immediate command. Protocol ID: 154. |
Method | get |
Gets the Wi-Fi password. Immediate command. Protocol ID: 152. |
Method | get |
Gets the Wi-Fi SSID. Immediate command. Protocol ID: 151. |
Method | initialize |
Initializes the robot with default parameters upon connection, including clearing the command queue, setting PTP joint, coordinate, jump, and common parameters, and getting the initial pose. |
Method | reset |
Resets the real-time pose of the robot. Immediate command. Protocol ID: 11. |
Method | set |
Sets static error for angle sensors. Immediate command. Protocol ID: 140. |
Method | set |
Executes an ARC (Arc) movement command. Protocol ID: 101. Can be queued. |
Method | set |
Sets parameters for ARC (Arc) movements. Protocol ID: 100. Can be queued. |
Method | set |
Sets auto-leveling parameters and initiates auto-leveling. Protocol ID: 32. Can be queued. |
Method | set |
Sets parameters for the color sensor. Protocol ID: 137. Can be queued. |
Method | set |
Executes a CP (Continuous Path) command. Protocol ID: 91. Can be queued. |
Method | set |
Executes a CP command for laser engraving. Protocol ID: 92. Can be queued. |
Method | set |
Sets parameters for CP (Continuous Path) movements. Protocol ID: 90. Can be queued. |
Method | set |
Sets the device name. Immediate command. Protocol ID: 1. |
Method | set |
Sets the device's rail capability. Immediate command. Protocol ID: 3. |
Method | set |
Sets the device serial number. Immediate command. Protocol ID: 0. |
Method | set |
Controls an external motor (stepper). Protocol ID: 135. Can be queued. |
Method | set |
Sets the status of the gripper. Protocol ID: 63. Can be queued. |
Method | set |
Controls the laser end effector. Protocol ID: 61. Can be queued. |
Method | set |
Sets parameters (bias) for the end effector. Protocol ID: 60. Can be queued. |
Method | set |
Sets the status of the suction cup. Protocol ID: 62. Can be queued. |
Method | set |
Sets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40. |
Method | set |
Enables/disables Hand Hold Teaching trigger output. Immediate command. Protocol ID: 41. |
Method | set |
Executes the homing function. Protocol ID: 31. Can be queued. |
Method | set |
Sets homing parameters (target coordinates). Protocol ID: 30. Can be queued. |
Method | set |
Sets digital output (DO) for a specific I/O. Protocol ID: 131. Can be queued. |
Method | set |
Sets I/O multiplexing configuration. Protocol ID: 130. Can be queued. |
Method | set |
Sets PWM output for a specific I/O. Protocol ID: 132. Can be queued. |
Method | set |
Sets parameters for the IR (Infrared) switch. Protocol ID: 138. Can be queued. |
Method | set |
Executes a JOG command. Protocol ID: 73. Can be queued. |
Method | set |
Sets common JOG parameters (velocity/acceleration ratios). Protocol ID: 72. Can be queued. |
Method | set |
Sets parameters for coordinate mode JOG movements. Protocol ID: 71. Can be queued. |
Method | set |
Sets parameters for joint mode JOG movements. Protocol ID: 70. Can be queued. |
Method | set |
Sets parameters for JOGL (linear jog) mode. Protocol ID: 74. Can be queued. |
Method | set |
Executes a losing-step detection command. Protocol ID: 171. Can be queued. |
Method | set |
Sets parameters for losing-step detection threshold. Immediate command. Protocol ID: 170. |
Method | set |
Executes a PTP (Point-to-Point) movement command. Protocol ID: 84. Can be queued. |
Method | set |
Sets common velocity/acceleration ratios for PTP mode. Protocol ID: 83. Can be queued. |
Method | set |
Sets velocity/acceleration of Cartesian axes in PTP mode. Protocol ID: 81. Can be queued. |
Method | set |
Sets velocity/acceleration for joints in PTP mode. Protocol ID: 80. Can be queued. |
Method | set |
Sets extended jump parameters for PTP movements. Protocol ID: 87. Can be queued. |
Method | set |
Sets lifting height for JUMP mode in PTP. Protocol ID: 82. Can be queued. |
Method | set |
Executes a PTP command with multiple PO (Point Output) commands. Protocol ID: 88. Can be queued. |
Method | set |
Executes a PTP command with rail and PO commands. Protocol ID: 89. Can be queued. |
Method | set |
Executes a PTP command with rail movement. Protocol ID: 86. Can be queued. |
Method | set |
Sets parameters for PTPL (Point-to-Point Linear) mode. Protocol ID: 85. Can be queued. |
Method | set |
Clears the command queue. Immediate command. Protocol ID: 245. |
Method | set |
Forces stop of command execution in queue. Immediate command. Protocol ID: 242. |
Method | set |
Starts downloading commands to queue for offline execution. Immediate command. Protocol ID: 243. |
Method | set |
Starts execution of commands in the queue. Immediate command. Protocol ID: 240. |
Method | set |
Stops downloading commands to the queue. Immediate command. Protocol ID: 244. |
Method | set |
Stops execution of commands in the queue. Immediate command. Protocol ID: 241. |
Method | set |
Executes a TRIG (Trigger) command. Protocol ID: 120. Can be queued. |
Method | set |
Adds a wait command to the queue. Protocol ID: 110. Can be queued. |
Method | set |
Enables or disables Wi-Fi configuration mode. Immediate command. Protocol ID: 150. |
Method | set |
Sets Wi-Fi DNS settings. Immediate command. Protocol ID: 156. |
Method | set |
Sets Wi-Fi gateway settings. Immediate command. Protocol ID: 155. |
Method | set |
Sets Wi-Fi IP address settings. Immediate command. Protocol ID: 153. |
Method | set |
Sets Wi-Fi netmask settings. Immediate command. Protocol ID: 154. |
Method | set |
Sets the Wi-Fi password. Immediate command. Protocol ID: 152. |
Method | set |
Sets the Wi-Fi SSID. Immediate command. Protocol ID: 151. |
Instance Variable | conn |
Undocumented |
Instance Variable | lock |
Undocumented |
Instance Variable | verbose |
Undocumented |
Method | _read |
Reads a message from the serial connection. |
Method | _send |
Sends a message to the Dobot and optionally waits for its execution if queued. |
Method | _send |
Helper method to construct and send a command message. |
Method | _send |
Writes a message to the Dobot's serial connection. |
Instance Variable | _on |
Undocumented |
Constructor for the DobotApi class.
Parameters | |
dobotDobotConnection | An instance of DobotConnection handling the serial communication. |
verbose:bool | If True, enables verbose output for debugging (default: False). |
Clears all alarm states of the Dobot. Immediate command. Protocol ID: 20 (rw=1). (Note: PDF Table 29 shows ID 21 for Clear, assuming ID 20 with rw=1)
Gets the current active alarms of the Dobot. Immediate command. Protocol ID: 20.
Returns | |
set[ | A set of Alarm enum members representing the active alarms. |
Gets parameters for ARC movements. Immediate command. Protocol ID: 100.
Returns | |
tagARCParams | Current ARC parameters. |
Gets automatic leveling result/status. Immediate command. Protocol ID: 32.
Returns | |
float | AutoLevelingResult (float, accuracy or status). |
Gets parameters for CP movements. Immediate command. Protocol ID: 90.
Returns | |
tagCPParams | Current CP parameters. |
Gets device's rail capability status. Immediate command. Protocol ID: 3.
Returns | |
bool | True if rail enabled/present, False otherwise. |
Gets the device serial number. Immediate command. Protocol ID: 0.
Returns | |
str | Device Serial Number as a string. |
Gets the device's internal time (system tick). Immediate command. Protocol ID: 4.
Returns | |
int | System Tick (uint32_t). |
Gets parameters (bias) for the end effector. Immediate command. Protocol ID: 60.
Returns | |
tagEndEffectorParams | Current end effector parameters. |
Gets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40.
Returns | |
HHTTrigMode | Current HHTTrigMode. |
Gets current Hand Hold Teaching trigger output value. Immediate command. Protocol ID: 42.
Returns | |
bool | True if triggered, False otherwise. |
Checks if Hand Hold Teaching trigger output is enabled. Immediate command. Protocol ID: 41.
Returns | |
bool | True if enabled, False otherwise. |
Gets homing parameters. Immediate command. Protocol ID: 30.
Returns | |
tagHomeParams | Current homing parameters. |
Gets ADC value for an I/O. Immediate command. Protocol ID: 134. Note: GetIOADC command takes no address param; response contains address and value.
Parameters | |
address:int | The EIO address (1-20) user is interested in. (Not sent to Dobot) |
Returns | |
int | ADC value (0-4095). Caller should check response address. |
Gets digital input (DI) status for an I/O. Immediate command. Protocol ID: 133. Note: GetIODI command takes no address param; response contains address and level.
Parameters | |
address:int | The EIO address (1-20) user is interested in. (Not sent to Dobot) |
Returns | |
Level | The Level of the DI. Caller should check response address. |
Gets digital output (DO) status for an I/O. Immediate command. Protocol ID: 131. Note: GetIODO command takes no address param; response contains address and level.
Parameters | |
address:int | The EIO address (1-20) user is interested in. (Not sent to Dobot) |
Returns | |
Level | The Level of the DO. Caller should check response address if specific one is needed. |
Gets I/O multiplexing configuration. Immediate command. Protocol ID: 130. Note: Protocol implies getting config for an address, but Get command takes no address.
Returns | |
tagIOMultiplexing | Current I/O multiplexing configuration (likely for a default/first address). |
Gets PWM output status for an I/O. Immediate command. Protocol ID: 132. Note: GetIOPWM command takes no address param; response contains address and PWM config.
Parameters | |
address:int | The EIO address (1-20) user is interested in. (Not sent to Dobot) |
Returns | |
tagIOPWM | PWM configuration. Caller should check response address. |
Gets the status of the IR switch. Immediate command. Protocol ID: 138.
Returns | |
bool | True if IR switch is triggered/active, False otherwise. |
Gets common JOG parameters. Immediate command. Protocol ID: 72.
Returns | |
tagJOGCommonParams | Current common JOG parameters. |
Gets parameters for coordinate mode JOG movements. Immediate command. Protocol ID: 71.
Returns | |
tagJOGCoordinateParams | Current JOG coordinate parameters. |
Gets parameters for joint mode JOG movements. Immediate command. Protocol ID: 70.
Returns | |
tagJOGJointParams | Current JOG joint parameters. |
Gets parameters for JOGL (linear jog) mode. Immediate command. Protocol ID: 74.
Returns | |
tagJOGLParams | Current JOGL parameters. |
Gets the rail pose (position of sliding rail). Immediate command. Protocol ID: 13.
Returns | |
float | Position of rail (float). |
Gets PTP common parameters. Immediate command. Protocol ID: 83.
Returns | |
tagPTPCommonParams | Current PTP common parameters. |
Gets PTP coordinate parameters. Immediate command. Protocol ID: 81.
Returns | |
tagPTPCoordinateParams | Current PTP coordinate parameters. |
Gets PTP joint parameters. Immediate command. Protocol ID: 80.
Returns | |
tagPTPJointParams | Current PTP joint parameters. |
Gets extended jump parameters for PTP movements. Immediate command. Protocol ID: 87.
Returns | |
tagPTPJump2Params | Current PTP jump2 parameters. |
Gets PTP jump parameters. Immediate command. Protocol ID: 82.
Returns | |
tagPTPJumpParams | Current PTP jump parameters. |
Gets parameters for PTPL mode. Immediate command. Protocol ID: 85.
Returns | |
tagPTPLParams | Current PTPL parameters. |
Retrieves the current index of the command being executed in the queue. The Dobot protocol specifies this index is a 64-bit unsigned integer.
Returns | |
int | The current command index (int). |
Gets Wi-Fi configuration mode status. Immediate command. Protocol ID: 150.
Returns | |
bool | True if Wi-Fi config mode enabled, False otherwise. |
Gets Wi-Fi connection status. Immediate command. Protocol ID: 157.
Returns | |
bool | True if connected, False otherwise. |
Gets Wi-Fi gateway settings. Immediate command. Protocol ID: 155.
Returns | |
tagWIFIGateway | WIFIGateway structure. |
Gets Wi-Fi IP address settings. Immediate command. Protocol ID: 153.
Returns | |
tagWIFIIPAddress | WIFIIPAddress structure. |
Gets Wi-Fi netmask settings. Immediate command. Protocol ID: 154.
Returns | |
tagWIFINetmask | WIFINetmask structure. |
Initializes the robot with default parameters upon connection, including clearing the command queue, setting PTP joint, coordinate, jump, and common parameters, and getting the initial pose.
tagARCCmd
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes an ARC (Arc) movement command. Protocol ID: 101. Can be queued.
Parameters | |
cmd:tagARCCmd | ARC command parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagARCParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for ARC (Arc) movements. Protocol ID: 100. Can be queued.
Parameters | |
params:tagARCParams | ARC parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagAutoLevelingParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets auto-leveling parameters and initiates auto-leveling. Protocol ID: 32. Can be queued.
Parameters | |
params:tagAutoLevelingParams | Auto-leveling parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagDevice
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for the color sensor. Protocol ID: 137. Can be queued.
Parameters | |
params:tagDevice | Device parameters for color sensor (isEnable, port, version). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagCPCmd
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes a CP command for laser engraving. Protocol ID: 92. Can be queued.
Parameters | |
cmd:tagCPCmd | CP command (used for laser engraving context). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagCPParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for CP (Continuous Path) movements. Protocol ID: 90. Can be queued.
Parameters | |
params:tagCPParams | CP parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
Sets the device's rail capability. Immediate command. Protocol ID: 3.
Parameters | |
params:tagWithL | Rail version and enable status. |
Sets the device serial number. Immediate command. Protocol ID: 0.
Parameters | |
devicestr | The serial number to set. |
tagEMOTOR
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Controls an external motor (stepper). Protocol ID: 135. Can be queued.
Parameters | |
params:tagEMOTOR | External motor parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
bool
= True, grip: bool
= False, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets the status of the gripper. Protocol ID: 63. Can be queued.
Parameters | |
enable:bool | True to enable (grip), False to disable (release). |
grip:bool | Undocumented |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
bool
, on: bool
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Controls the laser end effector. Protocol ID: 61. Can be queued.
Parameters | |
enablebool | True to enable laser control (typically True for setting). |
on:bool | True to turn laser on, False to turn off. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagEndEffectorParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters (bias) for the end effector. Protocol ID: 60. Can be queued.
Parameters | |
params:tagEndEffectorParams | End effector parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
bool
= False, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets the status of the suction cup. Protocol ID: 62. Can be queued.
Parameters | |
enable:bool | True to turn on suction, False to turn off. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
Sets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40.
Parameters | |
mode:HHTTrigMode | The HHT trigger mode. |
Enables/disables Hand Hold Teaching trigger output. Immediate command. Protocol ID: 41.
Parameters | |
isbool | True to enable, False to disable. |
tagHomeCmd
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes the homing function. Protocol ID: 31. Can be queued.
Parameters | |
params:tagHomeCmd | Homing command options (reserved). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagHomeParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets homing parameters (target coordinates). Protocol ID: 30. Can be queued.
Parameters | |
params:tagHomeParams | Homing parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagIODO
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets digital output (DO) for a specific I/O. Protocol ID: 131. Can be queued.
Parameters | |
params:tagIODO | I/O DO parameters (address, level). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagIOMultiplexing
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets I/O multiplexing configuration. Protocol ID: 130. Can be queued.
Parameters | |
params:tagIOMultiplexing | I/O multiplexing parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagIOPWM
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets PWM output for a specific I/O. Protocol ID: 132. Can be queued.
Parameters | |
params:tagIOPWM | I/O PWM parameters (address, frequency, dutyCycle). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagDevice
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for the IR (Infrared) switch. Protocol ID: 138. Can be queued.
Parameters | |
params:tagDevice | Device parameters for IR switch (isEnable, port, version). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagJOGCommonParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets common JOG parameters (velocity/acceleration ratios). Protocol ID: 72. Can be queued.
Parameters | |
params:tagJOGCommonParams | Common JOG parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagJOGCoordinateParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for coordinate mode JOG movements. Protocol ID: 71. Can be queued.
Parameters | |
params:tagJOGCoordinateParams | JOG coordinate parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagJOGJointParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for joint mode JOG movements. Protocol ID: 70. Can be queued.
Parameters | |
params:tagJOGJointParams | JOG joint parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagJOGLParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for JOGL (linear jog) mode. Protocol ID: 74. Can be queued.
Parameters | |
params:tagJOGLParams | JOGL parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
Sets parameters for losing-step detection threshold. Immediate command. Protocol ID: 170.
Parameters | |
value:float | Threshold value for lost step parameters (float). |
Returns | |
Message | The response message from the Dobot. |
tagPTPCmd
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes a PTP (Point-to-Point) movement command. Protocol ID: 84. Can be queued.
Parameters | |
cmd:tagPTPCmd | PTP command parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPCommonParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets common velocity/acceleration ratios for PTP mode. Protocol ID: 83. Can be queued.
Parameters | |
params:tagPTPCommonParams | Common PTP parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPCoordinateParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets velocity/acceleration of Cartesian axes in PTP mode. Protocol ID: 81. Can be queued.
Parameters | |
params:tagPTPCoordinateParams | Coordinate PTP parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPJointParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets velocity/acceleration for joints in PTP mode. Protocol ID: 80. Can be queued.
Parameters | |
params:tagPTPJointParams | Joint PTP parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPJump2Params
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets extended jump parameters for PTP movements. Protocol ID: 87. Can be queued.
Parameters | |
params:tagPTPJump2Params | PTP jump2 parameters (start/end jump heights). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPJumpParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets lifting height for JUMP mode in PTP. Protocol ID: 82. Can be queued.
Parameters | |
params:tagPTPJumpParams | Jump PTP parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPCmd
, po_cmds: list[ tagPOCmd]
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes a PTP command with multiple PO (Point Output) commands. Protocol ID: 88. Can be queued.
Parameters | |
ptptagPTPCmd | The PTP command. |
polist[ | A list of PO commands. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPWithLCmd
, po_cmds: list[ tagPOCmd]
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes a PTP command with rail and PO commands. Protocol ID: 89. Can be queued.
Parameters | |
ptptagPTPWithLCmd | PTP command with rail. |
polist[ | A list of PO commands. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPWithLCmd
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Executes a PTP command with rail movement. Protocol ID: 86. Can be queued.
Parameters | |
cmd:tagPTPWithLCmd | PTP command with rail parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
tagPTPLParams
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Sets parameters for PTPL (Point-to-Point Linear) mode. Protocol ID: 85. Can be queued.
Parameters | |
params:tagPTPLParams | PTPL parameters. |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
Clears the command queue. Immediate command. Protocol ID: 245.
Returns | |
Message | The response message from the Dobot. |
Forces stop of command execution in queue. Immediate command. Protocol ID: 242.
Returns | |
Message | The response message from the Dobot. |
Starts execution of commands in the queue. Immediate command. Protocol ID: 240.
Returns | |
Message | The response message from the Dobot. |
Stops downloading commands to the queue. Immediate command. Protocol ID: 244.
Returns | |
Message | The response message from the Dobot. |
Stops execution of commands in the queue. Immediate command. Protocol ID: 241.
Returns | |
Message | The response message from the Dobot. |
tagWAITCmd
, wait: bool
= False, is_queued: bool
= False) -> int | None
:
(source)
¶
Adds a wait command to the queue. Protocol ID: 110. Can be queued.
Parameters | |
params:tagWAITCmd | Wait command parameters (timeout in ms). |
wait:bool | If True and command is queued, waits for execution. |
isbool | If True, command is added to the queue. |
Returns | |
int | None | Queued command index if is_queued is True, else None. |
Enables or disables Wi-Fi configuration mode. Immediate command. Protocol ID: 150.
Parameters | |
enable:bool | True to enable, False to disable. |
Returns | |
Message | The response message from the Dobot. |
Sets Wi-Fi DNS settings. Immediate command. Protocol ID: 156.
Parameters | |
params:tagWIFIDNS | WIFIDNS structure. |
Returns | |
Message | The response message from the Dobot. |
Sets Wi-Fi gateway settings. Immediate command. Protocol ID: 155.
Parameters | |
params:tagWIFIGateway | WIFIGateway structure. |
Returns | |
Message | The response message from the Dobot. |
Sets Wi-Fi IP address settings. Immediate command. Protocol ID: 153.
Parameters | |
params:tagWIFIIPAddress | WIFIIPAddress structure. |
Returns | |
Message | The response message from the Dobot. |
Sets Wi-Fi netmask settings. Immediate command. Protocol ID: 154.
Parameters | |
params:tagWIFINetmask | WIFINetmask structure. |
Returns | |
Message | The response message from the Dobot. |
Sets the Wi-Fi password. Immediate command. Protocol ID: 152.
Parameters | |
password:str | The Wi-Fi password. |
Returns | |
Message | The response message from the Dobot. |
Sets the Wi-Fi SSID. Immediate command. Protocol ID: 151.
Parameters | |
ssid:str | The Wi-Fi SSID. |
Returns | |
Message | The response message from the Dobot. |
Reads a message from the serial connection.
Returns | |
Message | None | The received Message object, or None if no message is read. |
Sends a message to the Dobot and optionally waits for its execution if queued.
Parameters | |
msg:Message | The message object to send. msg.ctrl indicates if queued. |
wait:bool | If True AND command was queued, waits for execution. |
Returns | |
Message | The response message from the Dobot. |
Raises | |
TypeError | If no response is received. |
ValueError | If waiting for a queued command and response is malformed. |
CommunicationProtocolIDs
, control_value: ControlValues
, params: bytes | None
= None, wait: bool
= False, put_on_queue: bool
= False) -> Message
:
(source)
¶
Helper method to construct and send a command message.
Parameters | |
commandCommunicationProtocolIDs | The ID of the command. |
controlControlValues | The base control value (e.g., ReadWrite for set, Zero for get). |
params:bytes | None | Optional byte string of parameters. |
wait:bool | If True and command is queued, waits for execution. |
putbool | If True, command is added to Dobot's queue. |
Returns | |
Message | The response message from the Dobot. |