Skip to content

Dobot Api

This module provides a class to connect and interface with Dobot's arms

ATTRIBUTE DESCRIPTION
DASHBOARD_PORT

port number for the dashboard API

TYPE: int

FEEDBACK_PORT

port number for the feedback API

TYPE: int

CLASS DESCRIPTION
DobotDevice

DobotDevice provides methods to connect and interface with Dobot's arms

Documentation last updated: 2025-02-22

DobotDevice

DobotDevice(
    host: str,
    port: int | None = None,
    timeout: int = 10,
    *,
    simulation: bool = False,
    verbose: bool = False,
    **kwargs,
)

DobotDevice provides methods to connect and interface with Dobot's arms

ATTRIBUTE DESCRIPTION
host

device host

TYPE: str

port

device port

TYPE: int

timeout

device timeout

TYPE: int

connection_details

connection details for the device

TYPE: dict

dashboard_api

dashboard API for the device

TYPE: DobotApiDashboard

move_api

move API for the device

TYPE: DobotApiMove

flags

flags for the device

TYPE: SimpleNamespace[str, bool]

is_connected

whether the device is connected

TYPE: bool

verbose

verbosity of class

TYPE: bool

METHOD DESCRIPTION
connect

connect to the device

disconnect

disconnect from the device

reset

reset the device

clear

clear the input and output buffers

query

query the device

read

read data from the device

write

write data to the device

close

close the connection to the device

ClearError

clear any errors on the device

DisableRobot

disable the robot

EnableRobot

enable the robot

ResetRobot

stop the robot

SetArmOrientation

set the handedness of the robot

SpeedFactor

set the speed factor of the robot

GetAngle

get the angle of the robot

GetPose

get the pose of the robot

DOExecute

execute a digital output

JointMovJ

move the robot to the specified joint coordinates

MovJ

move the robot to the specified cartesian coordinates

RelMovJ

move the robot by the specified joint offsets

RelMovL

move the robot by the specified cartesian offsets

connection_details property

connection_details: dict

Connection details for the device

is_connected property

is_connected: bool

Whether the device is connected

verbose property writable

verbose: bool

Verbosity of class

ClearError

ClearError()

Clear any errors on the device

DOExecute

DOExecute(channel: int, on: int)

Execute a digital output

PARAMETER DESCRIPTION
channel

channel of the digital output

TYPE: int

on

whether to enable the digital output (1 or 0)

TYPE: int

DisableRobot

DisableRobot()

Disable the robot

EnableRobot

EnableRobot(*args)

Enable the robot

GetAngle

GetAngle()

Get the angle of the robot

GetPose

GetPose()

Get the pose of the robot

JointMovJ

JointMovJ(
    j1: float, j2: float, j3: float, j4: float, *args
)

Move the robot to the specified joint coordinates

PARAMETER DESCRIPTION
j1

joint 1 coordinate

TYPE: float

j2

joint 2 coordinate

TYPE: float

j3

joint 3 coordinate

TYPE: float

j4

joint 4 coordinate

TYPE: float

MovJ

MovJ(x: float, y: float, z: float, r: float, *args)

Move the robot to the specified cartesian coordinates

PARAMETER DESCRIPTION
x

x-coordinate

TYPE: float

y

y-coordinate

TYPE: float

z

z-coordinate

TYPE: float

r

r-coordinate

TYPE: float

RelMovJ

RelMovJ(
    offset1: float,
    offset2: float,
    offset3: float,
    offset4: float,
    *args,
)

Move the robot by the specified joint offsets

PARAMETER DESCRIPTION
offset1

joint 1 offset

TYPE: float

offset2

joint 2 offset

TYPE: float

offset3

joint 3 offset

TYPE: float

offset4

joint 4 offset

TYPE: float

RelMovL

RelMovL(
    offsetX: float,
    offsetY: float,
    offsetZ: float,
    offsetR: float,
    *args,
)

Move the robot by the specified cartesian offsets

PARAMETER DESCRIPTION
offsetX

x offset

TYPE: float

offsetY

y offset

TYPE: float

offsetZ

z offset

TYPE: float

offsetR

r offset

TYPE: float

ResetRobot

ResetRobot()

Stop the robot

SetArmOrientation

SetArmOrientation(right_handed: bool)

Set the handedness of the robot

PARAMETER DESCRIPTION
right_handed

whether to select right-handed mode

TYPE: bool

SpeedFactor

SpeedFactor(speed_factor: int)

Set the speed factor of the robot

PARAMETER DESCRIPTION
speed_factor

speed factor to set

TYPE: int

clear

clear()

Clear the input and output buffers

close

close()

Close the connection to the device

connect

connect()

Connect to the device

disconnect

disconnect()

Disconnect from the device

query

query(data: Any, lines: bool = True) -> list[str] | None

Query the device

PARAMETER DESCRIPTION
data

data to query

TYPE: Any

RETURNS DESCRIPTION
list[str] | None

list[str]|None: data read from the device, if any

read

read(lines: bool = False) -> str | list[str]

Read data from the device

PARAMETER DESCRIPTION
lines

whether to read multiple lines. Defaults to False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
str | list[str]

str|list[str]: line(s) of data read from the device

reset

reset()

Reset the device

write

write(data: str) -> bool

Write data to the device

PARAMETER DESCRIPTION
data

data to write

TYPE: str

RETURNS DESCRIPTION
bool

whether the write was successful

TYPE: bool