class documentation

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_all_alarms_state 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_active_alarms Gets the current active alarms of the Dobot. Immediate command. Protocol ID: 20.
Method get_angle_sensor_static_error Gets static error for angle sensors. Immediate command. Protocol ID: 140.
Method get_arc_params Gets parameters for ARC movements. Immediate command. Protocol ID: 100.
Method get_autoleveling Gets automatic leveling result/status. Immediate command. Protocol ID: 32.
Method get_color_sensor Gets readings (R, G, B) from the color sensor. Immediate command. Protocol ID: 137.
Method get_cp_params Gets parameters for CP movements. Immediate command. Protocol ID: 90.
Method get_device_id 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_device_name Gets the device name. Immediate command. Protocol ID: 1.
Method get_device_rail_capability Gets device's rail capability status. Immediate command. Protocol ID: 3.
Method get_device_sn Gets the device serial number. Immediate command. Protocol ID: 0.
Method get_device_time Gets the device's internal time (system tick). Immediate command. Protocol ID: 4.
Method get_device_version Gets the device firmware version. Immediate command. Protocol ID: 2.
Method get_end_effector_gripper Gets status of the gripper. Immediate command. Protocol ID: 63.
Method get_end_effector_laser Gets status of the laser end effector. Immediate command. Protocol ID: 61.
Method get_end_effector_params Gets parameters (bias) for the end effector. Immediate command. Protocol ID: 60.
Method get_end_effector_suction_cup Gets status of the suction cup. Immediate command. Protocol ID: 62.
Method get_hht_trig_mode Gets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40.
Method get_hht_trig_output Gets current Hand Hold Teaching trigger output value. Immediate command. Protocol ID: 42.
Method get_hht_trig_output_enabled Checks if Hand Hold Teaching trigger output is enabled. Immediate command. Protocol ID: 41.
Method get_home_params Gets homing parameters. Immediate command. Protocol ID: 30.
Method get_io_adc 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_io_di 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_io_do 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_io_multiplexing 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_io_pwm 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_ir_switch Gets the status of the IR switch. Immediate command. Protocol ID: 138.
Method get_jog_common_params Gets common JOG parameters. Immediate command. Protocol ID: 72.
Method get_jog_coordinate_params Gets parameters for coordinate mode JOG movements. Immediate command. Protocol ID: 71.
Method get_jog_joint_params Gets parameters for joint mode JOG movements. Immediate command. Protocol ID: 70.
Method get_jogl_params Gets parameters for JOGL (linear jog) mode. Immediate command. Protocol ID: 74.
Method get_pose Gets the real-time pose (position and joint angles) of the Dobot.
Method get_pose_rail Gets the rail pose (position of sliding rail). Immediate command. Protocol ID: 13.
Method get_ptp_common_params Gets PTP common parameters. Immediate command. Protocol ID: 83.
Method get_ptp_coordinate_params Gets PTP coordinate parameters. Immediate command. Protocol ID: 81.
Method get_ptp_joint_params Gets PTP joint parameters. Immediate command. Protocol ID: 80.
Method get_ptp_jump2_params Gets extended jump parameters for PTP movements. Immediate command. Protocol ID: 87.
Method get_ptp_jump_params Gets PTP jump parameters. Immediate command. Protocol ID: 82.
Method get_ptpl_params Gets parameters for PTPL mode. Immediate command. Protocol ID: 85.
Method get_queued_cmd_current_index 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_wifi_config_mode Gets Wi-Fi configuration mode status. Immediate command. Protocol ID: 150.
Method get_wifi_connect_status Gets Wi-Fi connection status. Immediate command. Protocol ID: 157.
Method get_wifi_dns Gets Wi-Fi DNS settings. Immediate command. Protocol ID: 156.
Method get_wifi_gateway Gets Wi-Fi gateway settings. Immediate command. Protocol ID: 155.
Method get_wifi_ip_address Gets Wi-Fi IP address settings. Immediate command. Protocol ID: 153.
Method get_wifi_netmask Gets Wi-Fi netmask settings. Immediate command. Protocol ID: 154.
Method get_wifi_password Gets the Wi-Fi password. Immediate command. Protocol ID: 152.
Method get_wifi_ssid Gets the Wi-Fi SSID. Immediate command. Protocol ID: 151.
Method initialize_robot 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_pose Resets the real-time pose of the robot. Immediate command. Protocol ID: 11.
Method set_angle_sensor_static_error Sets static error for angle sensors. Immediate command. Protocol ID: 140.
Method set_arc_cmd Executes an ARC (Arc) movement command. Protocol ID: 101. Can be queued.
Method set_arc_params Sets parameters for ARC (Arc) movements. Protocol ID: 100. Can be queued.
Method set_autoleveling Sets auto-leveling parameters and initiates auto-leveling. Protocol ID: 32. Can be queued.
Method set_color_sensor Sets parameters for the color sensor. Protocol ID: 137. Can be queued.
Method set_cp_cmd Executes a CP (Continuous Path) command. Protocol ID: 91. Can be queued.
Method set_cp_le_cmd Executes a CP command for laser engraving. Protocol ID: 92. Can be queued.
Method set_cp_params Sets parameters for CP (Continuous Path) movements. Protocol ID: 90. Can be queued.
Method set_device_name Sets the device name. Immediate command. Protocol ID: 1.
Method set_device_rail_capability Sets the device's rail capability. Immediate command. Protocol ID: 3.
Method set_device_sn Sets the device serial number. Immediate command. Protocol ID: 0.
Method set_e_motor Controls an external motor (stepper). Protocol ID: 135. Can be queued.
Method set_end_effector_gripper Sets the status of the gripper. Protocol ID: 63. Can be queued.
Method set_end_effector_laser Controls the laser end effector. Protocol ID: 61. Can be queued.
Method set_end_effector_params Sets parameters (bias) for the end effector. Protocol ID: 60. Can be queued.
Method set_end_effector_suction_cup Sets the status of the suction cup. Protocol ID: 62. Can be queued.
Method set_hht_trig_mode Sets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40.
Method set_hht_trig_output_enabled Enables/disables Hand Hold Teaching trigger output. Immediate command. Protocol ID: 41.
Method set_home_cmd Executes the homing function. Protocol ID: 31. Can be queued.
Method set_home_params Sets homing parameters (target coordinates). Protocol ID: 30. Can be queued.
Method set_io_do Sets digital output (DO) for a specific I/O. Protocol ID: 131. Can be queued.
Method set_io_multiplexing Sets I/O multiplexing configuration. Protocol ID: 130. Can be queued.
Method set_io_pwm Sets PWM output for a specific I/O. Protocol ID: 132. Can be queued.
Method set_ir_switch Sets parameters for the IR (Infrared) switch. Protocol ID: 138. Can be queued.
Method set_jog_cmd Executes a JOG command. Protocol ID: 73. Can be queued.
Method set_jog_common_params Sets common JOG parameters (velocity/acceleration ratios). Protocol ID: 72. Can be queued.
Method set_jog_coordinate_params Sets parameters for coordinate mode JOG movements. Protocol ID: 71. Can be queued.
Method set_jog_joint_params Sets parameters for joint mode JOG movements. Protocol ID: 70. Can be queued.
Method set_jogl_params Sets parameters for JOGL (linear jog) mode. Protocol ID: 74. Can be queued.
Method set_lost_step_cmd Executes a losing-step detection command. Protocol ID: 171. Can be queued.
Method set_lost_step_params Sets parameters for losing-step detection threshold. Immediate command. Protocol ID: 170.
Method set_ptp_cmd Executes a PTP (Point-to-Point) movement command. Protocol ID: 84. Can be queued.
Method set_ptp_common_params Sets common velocity/acceleration ratios for PTP mode. Protocol ID: 83. Can be queued.
Method set_ptp_coordinate_params Sets velocity/acceleration of Cartesian axes in PTP mode. Protocol ID: 81. Can be queued.
Method set_ptp_joint_params Sets velocity/acceleration for joints in PTP mode. Protocol ID: 80. Can be queued.
Method set_ptp_jump2_params Sets extended jump parameters for PTP movements. Protocol ID: 87. Can be queued.
Method set_ptp_jump_params Sets lifting height for JUMP mode in PTP. Protocol ID: 82. Can be queued.
Method set_ptp_po_cmd Executes a PTP command with multiple PO (Point Output) commands. Protocol ID: 88. Can be queued.
Method set_ptp_po_with_rail_cmd Executes a PTP command with rail and PO commands. Protocol ID: 89. Can be queued.
Method set_ptp_with_rail_cmd Executes a PTP command with rail movement. Protocol ID: 86. Can be queued.
Method set_ptpl_params Sets parameters for PTPL (Point-to-Point Linear) mode. Protocol ID: 85. Can be queued.
Method set_queued_cmd_clear Clears the command queue. Immediate command. Protocol ID: 245.
Method set_queued_cmd_force_stop_exec Forces stop of command execution in queue. Immediate command. Protocol ID: 242.
Method set_queued_cmd_start_download Starts downloading commands to queue for offline execution. Immediate command. Protocol ID: 243.
Method set_queued_cmd_start_exec Starts execution of commands in the queue. Immediate command. Protocol ID: 240.
Method set_queued_cmd_stop_download Stops downloading commands to the queue. Immediate command. Protocol ID: 244.
Method set_queued_cmd_stop_exec Stops execution of commands in the queue. Immediate command. Protocol ID: 241.
Method set_trig_cmd Executes a TRIG (Trigger) command. Protocol ID: 120. Can be queued.
Method set_wait_cmd Adds a wait command to the queue. Protocol ID: 110. Can be queued.
Method set_wifi_config_mode Enables or disables Wi-Fi configuration mode. Immediate command. Protocol ID: 150.
Method set_wifi_dns Sets Wi-Fi DNS settings. Immediate command. Protocol ID: 156.
Method set_wifi_gateway Sets Wi-Fi gateway settings. Immediate command. Protocol ID: 155.
Method set_wifi_ip_address Sets Wi-Fi IP address settings. Immediate command. Protocol ID: 153.
Method set_wifi_netmask Sets Wi-Fi netmask settings. Immediate command. Protocol ID: 154.
Method set_wifi_password Sets the Wi-Fi password. Immediate command. Protocol ID: 152.
Method set_wifi_ssid Sets the Wi-Fi SSID. Immediate command. Protocol ID: 151.
Instance Variable conn Undocumented
Instance Variable lock Undocumented
Instance Variable verbose Undocumented
Method _read_message Reads a message from the serial connection.
Method _send_command Sends a message to the Dobot and optionally waits for its execution if queued.
Method _send_command_with_params Helper method to construct and send a command message.
Method _send_message Writes a message to the Dobot's serial connection.
Instance Variable _on Undocumented
def __del__(self): (source)

Destructor that ensures the connection is closed when the object is deleted.

def __init__(self, dobot_connection: DobotConnection, verbose: bool = False): (source)

Constructor for the DobotApi class.

Parameters
dobot_connection:DobotConnectionAn instance of DobotConnection handling the serial communication.
verbose:boolIf True, enables verbose output for debugging (default: False).
def clear_all_alarms_state(self): (source)

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)

def close(self): (source)

Closes the serial connection to the Dobot and releases the lock.

def get_active_alarms(self) -> set[Alarm]: (source)

Gets the current active alarms of the Dobot. Immediate command. Protocol ID: 20.

Returns
set[Alarm]A set of Alarm enum members representing the active alarms.
def get_angle_sensor_static_error(self) -> tuple[float, float]: (source)

Gets static error for angle sensors. Immediate command. Protocol ID: 140.

Returns
tuple[float, float]Tuple (rear_arm_angle_error, front_arm_angle_error).
def get_arc_params(self) -> tagARCParams: (source)

Gets parameters for ARC movements. Immediate command. Protocol ID: 100.

Returns
tagARCParamsCurrent ARC parameters.
def get_autoleveling(self) -> float: (source)

Gets automatic leveling result/status. Immediate command. Protocol ID: 32.

Returns
floatAutoLevelingResult (float, accuracy or status).
def get_color_sensor(self, port: int) -> tuple[int, int, int]: (source)

Gets readings (R, G, B) from the color sensor. Immediate command. Protocol ID: 137.

Returns
tuple[int, int, int]Tuple (r, g, b) color values (uint8_t each).
def get_cp_params(self) -> tagCPParams: (source)

Gets parameters for CP movements. Immediate command. Protocol ID: 90.

Returns
tagCPParamsCurrent CP parameters.
def get_device_id(self) -> tuple[int, int, int]: (source)

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]

Returns
tuple[int, int, int]Device ID as a tuple of 3 uint32_t values.
def get_device_name(self) -> str: (source)

Gets the device name. Immediate command. Protocol ID: 1.

Returns
strDevice Name as a string.
def get_device_rail_capability(self) -> bool: (source)

Gets device's rail capability status. Immediate command. Protocol ID: 3.

Returns
boolTrue if rail enabled/present, False otherwise.
def get_device_sn(self) -> str: (source)

Gets the device serial number. Immediate command. Protocol ID: 0.

Returns
strDevice Serial Number as a string.
def get_device_time(self) -> int: (source)

Gets the device's internal time (system tick). Immediate command. Protocol ID: 4.

Returns
intSystem Tick (uint32_t).
def get_device_version(self) -> tuple[int, int, int]: (source)

Gets the device firmware version. Immediate command. Protocol ID: 2.

Returns
tuple[int, int, int]Tuple (Major version, Minor version, Revision version).
def get_end_effector_gripper(self) -> tuple[bool, bool]: (source)

Gets status of the gripper. Immediate command. Protocol ID: 63.

Returns
tuple[bool, bool]Tuple (isCtrlEnabled, isGripped).
def get_end_effector_laser(self) -> tuple[bool, bool]: (source)

Gets status of the laser end effector. Immediate command. Protocol ID: 61.

Returns
tuple[bool, bool]Tuple (isCtrlEnabled, isOn).
def get_end_effector_params(self) -> tagEndEffectorParams: (source)

Gets parameters (bias) for the end effector. Immediate command. Protocol ID: 60.

Returns
tagEndEffectorParamsCurrent end effector parameters.
def get_end_effector_suction_cup(self) -> tuple[bool, bool]: (source)

Gets status of the suction cup. Immediate command. Protocol ID: 62.

Returns
tuple[bool, bool]Tuple (isCtrlEnabled, isSucked).
def get_hht_trig_mode(self) -> HHTTrigMode: (source)

Gets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40.

Returns
HHTTrigModeCurrent HHTTrigMode.
def get_hht_trig_output(self) -> bool: (source)

Gets current Hand Hold Teaching trigger output value. Immediate command. Protocol ID: 42.

Returns
boolTrue if triggered, False otherwise.
def get_hht_trig_output_enabled(self) -> bool: (source)

Checks if Hand Hold Teaching trigger output is enabled. Immediate command. Protocol ID: 41.

Returns
boolTrue if enabled, False otherwise.
def get_home_params(self) -> tagHomeParams: (source)

Gets homing parameters. Immediate command. Protocol ID: 30.

Returns
tagHomeParamsCurrent homing parameters.
def get_io_adc(self, address: int) -> int: (source)

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:intThe EIO address (1-20) user is interested in. (Not sent to Dobot)
Returns
intADC value (0-4095). Caller should check response address.
def get_io_di(self, address: int) -> Level: (source)

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:intThe EIO address (1-20) user is interested in. (Not sent to Dobot)
Returns
LevelThe Level of the DI. Caller should check response address.
def get_io_do(self, address: int) -> Level: (source)

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:intThe EIO address (1-20) user is interested in. (Not sent to Dobot)
Returns
LevelThe Level of the DO. Caller should check response address if specific one is needed.
def get_io_multiplexing(self, address: int) -> tagIOMultiplexing: (source)

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
tagIOMultiplexingCurrent I/O multiplexing configuration (likely for a default/first address).
def get_io_pwm(self, address: int) -> tagIOPWM: (source)

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:intThe EIO address (1-20) user is interested in. (Not sent to Dobot)
Returns
tagIOPWMPWM configuration. Caller should check response address.
def get_ir_switch(self, port: int) -> bool: (source)

Gets the status of the IR switch. Immediate command. Protocol ID: 138.

Returns
boolTrue if IR switch is triggered/active, False otherwise.
def get_jog_common_params(self) -> tagJOGCommonParams: (source)

Gets common JOG parameters. Immediate command. Protocol ID: 72.

Returns
tagJOGCommonParamsCurrent common JOG parameters.
def get_jog_coordinate_params(self) -> tagJOGCoordinateParams: (source)

Gets parameters for coordinate mode JOG movements. Immediate command. Protocol ID: 71.

Returns
tagJOGCoordinateParamsCurrent JOG coordinate parameters.
def get_jog_joint_params(self) -> tagJOGJointParams: (source)

Gets parameters for joint mode JOG movements. Immediate command. Protocol ID: 70.

Returns
tagJOGJointParamsCurrent JOG joint parameters.
def get_jogl_params(self) -> tagJOGLParams: (source)

Gets parameters for JOGL (linear jog) mode. Immediate command. Protocol ID: 74.

Returns
tagJOGLParamsCurrent JOGL parameters.
def get_pose(self) -> tagPose: (source)

Gets the real-time pose (position and joint angles) of the Dobot.

Returns
tagPosePose data.
def get_pose_rail(self) -> float: (source)

Gets the rail pose (position of sliding rail). Immediate command. Protocol ID: 13.

Returns
floatPosition of rail (float).
def get_ptp_common_params(self) -> tagPTPCommonParams: (source)

Gets PTP common parameters. Immediate command. Protocol ID: 83.

Returns
tagPTPCommonParamsCurrent PTP common parameters.
def get_ptp_coordinate_params(self) -> tagPTPCoordinateParams: (source)

Gets PTP coordinate parameters. Immediate command. Protocol ID: 81.

Returns
tagPTPCoordinateParamsCurrent PTP coordinate parameters.
def get_ptp_joint_params(self) -> tagPTPJointParams: (source)

Gets PTP joint parameters. Immediate command. Protocol ID: 80.

Returns
tagPTPJointParamsCurrent PTP joint parameters.
def get_ptp_jump2_params(self) -> tagPTPJump2Params: (source)

Gets extended jump parameters for PTP movements. Immediate command. Protocol ID: 87.

Returns
tagPTPJump2ParamsCurrent PTP jump2 parameters.
def get_ptp_jump_params(self) -> tagPTPJumpParams: (source)

Gets PTP jump parameters. Immediate command. Protocol ID: 82.

Returns
tagPTPJumpParamsCurrent PTP jump parameters.
def get_ptpl_params(self) -> tagPTPLParams: (source)

Gets parameters for PTPL mode. Immediate command. Protocol ID: 85.

Returns
tagPTPLParamsCurrent PTPL parameters.
def get_queued_cmd_current_index(self) -> int: (source)

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
intThe current command index (int).
def get_wifi_config_mode(self) -> bool: (source)

Gets Wi-Fi configuration mode status. Immediate command. Protocol ID: 150.

Returns
boolTrue if Wi-Fi config mode enabled, False otherwise.
def get_wifi_connect_status(self) -> bool: (source)

Gets Wi-Fi connection status. Immediate command. Protocol ID: 157.

Returns
boolTrue if connected, False otherwise.
def get_wifi_dns(self) -> tagWIFIDNS: (source)

Gets Wi-Fi DNS settings. Immediate command. Protocol ID: 156.

Returns
tagWIFIDNSWIFIDNS structure.
def get_wifi_gateway(self) -> tagWIFIGateway: (source)

Gets Wi-Fi gateway settings. Immediate command. Protocol ID: 155.

Returns
tagWIFIGatewayWIFIGateway structure.
def get_wifi_ip_address(self) -> tagWIFIIPAddress: (source)

Gets Wi-Fi IP address settings. Immediate command. Protocol ID: 153.

Returns
tagWIFIIPAddressWIFIIPAddress structure.
def get_wifi_netmask(self) -> tagWIFINetmask: (source)

Gets Wi-Fi netmask settings. Immediate command. Protocol ID: 154.

Returns
tagWIFINetmaskWIFINetmask structure.
def get_wifi_password(self) -> str: (source)

Gets the Wi-Fi password. Immediate command. Protocol ID: 152.

Returns
strWi-Fi password as string.
def get_wifi_ssid(self) -> str: (source)

Gets the Wi-Fi SSID. Immediate command. Protocol ID: 151.

Returns
strWi-Fi SSID as string.
def initialize_robot(self): (source)

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.

def reset_pose(self, manual: int, rear_arm_angle: float, front_arm_angle: float): (source)

Resets the real-time pose of the robot. Immediate command. Protocol ID: 11.

Parameters
manual:intManual reset flag (0=auto, 1=manual with angles).
rear_arm_angle:floatRear arm angle for reset (if manual=1).
front_arm_angle:floatFront arm angle for reset (if manual=1).
def set_angle_sensor_static_error(self, rear_arm_angle_error: float, front_arm_angle_error: float) -> Message: (source)

Sets static error for angle sensors. Immediate command. Protocol ID: 140.

Parameters
rear_arm_angle_error:floatStatic error for rear arm angle sensor.
front_arm_angle_error:floatStatic error for front arm angle sensor.
Returns
MessageThe response message from the Dobot.
def set_arc_cmd(self, cmd: 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:tagARCCmdARC command parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_arc_params(self, params: 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:tagARCParamsARC parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_autoleveling(self, params: 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:tagAutoLevelingParamsAuto-leveling parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_color_sensor(self, params: 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:tagDeviceDevice parameters for color sensor (isEnable, port, version).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_cp_cmd(self, cmd: tagCPCmd, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Executes a CP (Continuous Path) command. Protocol ID: 91. Can be queued.

Parameters
cmd:tagCPCmdCP command parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_cp_le_cmd(self, cmd: 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:tagCPCmdCP command (used for laser engraving context).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_cp_params(self, params: 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:tagCPParamsCP parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_device_name(self, device_name: str): (source)

Sets the device name. Immediate command. Protocol ID: 1.

Parameters
device_name:strThe name to set.
def set_device_rail_capability(self, params: tagWithL): (source)

Sets the device's rail capability. Immediate command. Protocol ID: 3.

Parameters
params:tagWithLRail version and enable status.
def set_device_sn(self, device_serial_number: str): (source)

Sets the device serial number. Immediate command. Protocol ID: 0.

Parameters
device_serial_number:strThe serial number to set.
def set_e_motor(self, params: tagEMOTOR, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Controls an external motor (stepper). Protocol ID: 135. Can be queued.

Parameters
params:tagEMOTORExternal motor parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_end_effector_gripper(self, enable: 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:boolTrue to enable (grip), False to disable (release).
grip:boolUndocumented
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_end_effector_laser(self, enable_ctrl: 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
enable_ctrl:boolTrue to enable laser control (typically True for setting).
on:boolTrue to turn laser on, False to turn off.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_end_effector_params(self, params: 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:tagEndEffectorParamsEnd effector parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_end_effector_suction_cup(self, enable: 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:boolTrue to turn on suction, False to turn off.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_hht_trig_mode(self, mode: HHTTrigMode): (source)

Sets Hand Hold Teaching trigger mode. Immediate command. Protocol ID: 40.

Parameters
mode:HHTTrigModeThe HHT trigger mode.
def set_hht_trig_output_enabled(self, is_enabled: bool): (source)

Enables/disables Hand Hold Teaching trigger output. Immediate command. Protocol ID: 41.

Parameters
is_enabled:boolTrue to enable, False to disable.
def set_home_cmd(self, params: tagHomeCmd, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Executes the homing function. Protocol ID: 31. Can be queued.

Parameters
params:tagHomeCmdHoming command options (reserved).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_home_params(self, params: tagHomeParams, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Sets homing parameters (target coordinates). Protocol ID: 30. Can be queued.

Parameters
params:tagHomeParamsHoming parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_io_do(self, params: 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:tagIODOI/O DO parameters (address, level).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_io_multiplexing(self, params: tagIOMultiplexing, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Sets I/O multiplexing configuration. Protocol ID: 130. Can be queued.

Parameters
params:tagIOMultiplexingI/O multiplexing parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_io_pwm(self, params: 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:tagIOPWMI/O PWM parameters (address, frequency, dutyCycle).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ir_switch(self, params: 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:tagDeviceDevice parameters for IR switch (isEnable, port, version).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_jog_cmd(self, cmd: tagJOGCmd, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Executes a JOG command. Protocol ID: 73. Can be queued.

Parameters
cmd:tagJOGCmdJOG command parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_jog_common_params(self, params: 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:tagJOGCommonParamsCommon JOG parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_jog_coordinate_params(self, params: 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:tagJOGCoordinateParamsJOG coordinate parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_jog_joint_params(self, params: 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:tagJOGJointParamsJOG joint parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_jogl_params(self, params: 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:tagJOGLParamsJOGL parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_lost_step_cmd(self, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Executes a losing-step detection command. Protocol ID: 171. Can be queued.

Parameters
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_lost_step_params(self, value: float) -> Message: (source)

Sets parameters for losing-step detection threshold. Immediate command. Protocol ID: 170.

Parameters
value:floatThreshold value for lost step parameters (float).
Returns
MessageThe response message from the Dobot.
def set_ptp_cmd(self, cmd: 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:tagPTPCmdPTP command parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_common_params(self, params: 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:tagPTPCommonParamsCommon PTP parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_coordinate_params(self, params: 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:tagPTPCoordinateParamsCoordinate PTP parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_joint_params(self, params: 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:tagPTPJointParamsJoint PTP parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_jump2_params(self, params: 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:tagPTPJump2ParamsPTP jump2 parameters (start/end jump heights).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_jump_params(self, params: 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:tagPTPJumpParamsJump PTP parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_po_cmd(self, ptp_cmd: 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
ptp_cmd:tagPTPCmdThe PTP command.
po_cmds:list[tagPOCmd]A list of PO commands.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_po_with_rail_cmd(self, ptp_cmd: 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
ptp_cmd:tagPTPWithLCmdPTP command with rail.
po_cmds:list[tagPOCmd]A list of PO commands.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptp_with_rail_cmd(self, cmd: 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:tagPTPWithLCmdPTP command with rail parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_ptpl_params(self, params: 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:tagPTPLParamsPTPL parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_queued_cmd_clear(self) -> Message: (source)

Clears the command queue. Immediate command. Protocol ID: 245.

Returns
MessageThe response message from the Dobot.
def set_queued_cmd_force_stop_exec(self) -> Message: (source)

Forces stop of command execution in queue. Immediate command. Protocol ID: 242.

Returns
MessageThe response message from the Dobot.
def set_queued_cmd_start_download(self, total_loop: int, line_per_loop: int) -> Message: (source)

Starts downloading commands to queue for offline execution. Immediate command. Protocol ID: 243.

Parameters
total_loop:intTotal number of loops for command download.
line_per_loop:intNumber of lines per loop for command download.
Returns
MessageThe response message from the Dobot.
def set_queued_cmd_start_exec(self) -> Message: (source)

Starts execution of commands in the queue. Immediate command. Protocol ID: 240.

Returns
MessageThe response message from the Dobot.
def set_queued_cmd_stop_download(self) -> Message: (source)

Stops downloading commands to the queue. Immediate command. Protocol ID: 244.

Returns
MessageThe response message from the Dobot.
def set_queued_cmd_stop_exec(self) -> Message: (source)

Stops execution of commands in the queue. Immediate command. Protocol ID: 241.

Returns
MessageThe response message from the Dobot.
def set_trig_cmd(self, cmd: tagTRIGCmd, wait: bool = False, is_queued: bool = False) -> int | None: (source)

Executes a TRIG (Trigger) command. Protocol ID: 120. Can be queued.

Parameters
cmd:tagTRIGCmdTRIG command parameters.
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_wait_cmd(self, params: 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:tagWAITCmdWait command parameters (timeout in ms).
wait:boolIf True and command is queued, waits for execution.
is_queued:boolIf True, command is added to the queue.
Returns
int | NoneQueued command index if is_queued is True, else None.
def set_wifi_config_mode(self, enable: bool) -> Message: (source)

Enables or disables Wi-Fi configuration mode. Immediate command. Protocol ID: 150.

Parameters
enable:boolTrue to enable, False to disable.
Returns
MessageThe response message from the Dobot.
def set_wifi_dns(self, params: tagWIFIDNS) -> Message: (source)

Sets Wi-Fi DNS settings. Immediate command. Protocol ID: 156.

Parameters
params:tagWIFIDNSWIFIDNS structure.
Returns
MessageThe response message from the Dobot.
def set_wifi_gateway(self, params: tagWIFIGateway) -> Message: (source)

Sets Wi-Fi gateway settings. Immediate command. Protocol ID: 155.

Parameters
params:tagWIFIGatewayWIFIGateway structure.
Returns
MessageThe response message from the Dobot.
def set_wifi_ip_address(self, params: tagWIFIIPAddress) -> Message: (source)

Sets Wi-Fi IP address settings. Immediate command. Protocol ID: 153.

Parameters
params:tagWIFIIPAddressWIFIIPAddress structure.
Returns
MessageThe response message from the Dobot.
def set_wifi_netmask(self, params: tagWIFINetmask) -> Message: (source)

Sets Wi-Fi netmask settings. Immediate command. Protocol ID: 154.

Parameters
params:tagWIFINetmaskWIFINetmask structure.
Returns
MessageThe response message from the Dobot.
def set_wifi_password(self, password: str) -> Message: (source)

Sets the Wi-Fi password. Immediate command. Protocol ID: 152.

Parameters
password:strThe Wi-Fi password.
Returns
MessageThe response message from the Dobot.
def set_wifi_ssid(self, ssid: str) -> Message: (source)

Sets the Wi-Fi SSID. Immediate command. Protocol ID: 151.

Parameters
ssid:strThe Wi-Fi SSID.
Returns
MessageThe response message from the Dobot.

Undocumented

def _read_message(self) -> Message | None: (source)

Reads a message from the serial connection.

Returns
Message | NoneThe received Message object, or None if no message is read.
def _send_command(self, msg: Message, wait: bool = False) -> Message: (source)

Sends a message to the Dobot and optionally waits for its execution if queued.

Parameters
msg:MessageThe message object to send. msg.ctrl indicates if queued.
wait:boolIf True AND command was queued, waits for execution.
Returns
MessageThe response message from the Dobot.
Raises
TypeErrorIf no response is received.
ValueErrorIf waiting for a queued command and response is malformed.
def _send_command_with_params(self, command_id: 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
command_id:CommunicationProtocolIDsThe ID of the command.
control_value:ControlValuesThe base control value (e.g., ReadWrite for set, Zero for get).
params:bytes | NoneOptional byte string of parameters.
wait:boolIf True and command is queued, waits for execution.
put_on_queue:boolIf True, command is added to Dobot's queue.
Returns
MessageThe response message from the Dobot.
def _send_message(self, msg: Message): (source)

Writes a message to the Dobot's serial connection.

Parameters
msg:MessageThe message object to send.

Undocumented