Skip to content

M1Pro

This module provides methods to control Dobot's M1Pro robot arm

ATTRIBUTE DESCRIPTION
DEFAULT_SPEEDS

default speeds of the robot

TYPE: dict

CLASS DESCRIPTION
M1Pro

M1Pro provides methods to control Dobot's M1Pro robot arm

FUNCTION DESCRIPTION
within_volume

check if a point is within the robot's workspace

Documentation last updated: 2025-02-22

M1Pro

M1Pro(
    host: str,
    joint_limits: Sequence[Sequence[float]] | None = None,
    right_handed: bool = True,
    *,
    robot_position: Position = Position(),
    home_waypoints: Sequence[Position] | None = None,
    home_position: Position = Position((300, 0, 240)),
    tool_offset: Position = Position(),
    calibrated_offset: Position = Position(),
    scale: float = 1.0,
    deck: Deck | None = None,
    safe_height: float | None = 240,
    saved_positions: dict | None = None,
    speed_max: float | None = None,
    movement_buffer: int | None = None,
    movement_timeout: int | None = None,
    verbose: bool = False,
    simulation: bool = False,
    **kwargs,
)

Bases: Dobot

M1Pro provides methods to control Dobot's M1Pro robot arm

ATTRIBUTE DESCRIPTION
movement_buffer

buffer time for movement

TYPE: int

movement_timeout

timeout for movement

TYPE: int

max_joint_accels

maximum joint accelerations of the robot

TYPE: ndarray

max_joint_speeds

maximum joint speeds of the robot

TYPE: ndarray

home_waypoints

home waypoints for the robot

TYPE: list[Position]

joint_limits

joint limits for the robot

TYPE: ndarray

joint_position

current joint angles

TYPE: ndarray

connection_details

connection details for the device

TYPE: dict

device

device object that communicates with physical tool

TYPE: Device

flags

flags for the class

TYPE: SimpleNamespace[str, bool]

is_busy

whether the device is busy

TYPE: bool

is_connected

whether the device is connected

TYPE: bool

verbose

verbosity of class

TYPE: bool

deck

Deck object for workspace

TYPE: Deck

workspace

workspace bounding box

TYPE: BoundingVolume

safe_height

safe height in terms of robot coordinate system

TYPE: float

saved_positions

dictionary of saved positions

TYPE: dict

current_zone_waypoints

current zone entry waypoints

TYPE: tuple[str, list[Position]]

speed

travel speed of robot

TYPE: float

speed_factor

fraction of maximum travel speed of robot

TYPE: float

speed_max

maximum speed of robot in mm/min

TYPE: float

robot_position

current position of the robot

TYPE: Position

home_position

home position of the robot in terms of robot coordinate system

TYPE: Position

tool_offset

tool offset from robot to end effector

TYPE: Position

calibrated_offset

calibrated offset from robot to work position

TYPE: Position

scale

factor to scale the basis vectors by

TYPE: float

tool_position

robot position of the tool end effector

TYPE: Position

work_position

work position of the robot

TYPE: Position

worktool_position

work position of the tool end effector

TYPE: Position

position

work position of the tool end effector; alias for worktool_position

TYPE: Position

METHOD DESCRIPTION
setHandedness

set the handedness of the robot

isFeasibleJoint

checks and returns whether the target joint angles are feasible

jointMoveBy

move the robot by target joint angles

jointMoveTo

move the robot to target joint position

updateJointPosition

update the joint position based on relative or absolute movement

connect

connect to the device

disconnect

disconnect from the device

resetFlags

reset all flags to class attribute _default_flags

shutdown

shutdown procedure for tool

enterZone

enter a zone on the deck

exitZone

exit the current zone on the deck

halt

halt robot movement

home

make the robot go home

isFeasible

checks and returns whether the target coordinates is feasible and sets the handedness of the robot if necessary

loadDeck

load Deck layout object to mover

loadDeckFromDict

load Deck layout object from dictionary

loadDeckFromFile

load Deck layout object from file

move

move the robot in a specific axis by a specific value

moveBy

move the robot by target direction

moveTo

move the robot to target position

moveToSafeHeight

move the robot to safe height

moveRobotTo

move the robot to target position

moveToolTo

move the tool end effector to target position

reset

reset the robot

rotate

rotate the robot in a specific axis by a specific value

rotateBy

rotate the robot by target rotation

rotateTo

rotate the robot to target orientation

rotateRobotTo

rotate the robot to target orientation

rotateToolTo

rotate the tool end effector to target orientation

safeMoveTo

safe version of moveTo by moving to safe height first

setSafeHeight

set safe height for robot

setSpeedFactor

set the speed factor of the robot

setToolOffset

set the tool offset of the robot

showWorkspace

show the workspace of the robot

updateRobotPosition

update the robot position

transformRobotToTool

transform robot coordinates to tool coordinates

transformRobotToWork

transform robot coordinates to work coordinates

transformToolToRobot

transform tool coordinates to robot coordinates

transformWorkToRobot

transform work coordinates to robot coordinates

calibrate

calibrate the internal and external coordinate systems

Initialize M1Pro class

PARAMETER DESCRIPTION
host

IP address of Dobot

TYPE: str

joint_limits

joint limits of the robot. Defaults to None.

TYPE: Sequence[Sequence[float]] | None DEFAULT: None

right_handed

whether the robot is in right-handed mode (i.e elbow bends to the right). Defaults to True.

TYPE: bool DEFAULT: True

robot_position

current position of the robot. Defaults to Position().

TYPE: Position DEFAULT: Position()

home_waypoints

home waypoints for the robot. Defaults to list().

TYPE: Sequence[Position] DEFAULT: None

home_position

home position of the robot in terms of robot coordinate system. Defaults to Position((300,0,240)).

TYPE: Position DEFAULT: Position((300, 0, 240))

tool_offset

tool offset from robot to end effector. Defaults to Position().

TYPE: Position DEFAULT: Position()

calibrated_offset

calibrated offset from robot to work position. Defaults to Position().

TYPE: Position DEFAULT: Position()

scale

factor to scale the basis vectors by. Defaults to 1.0.

TYPE: float DEFAULT: 1.0

deck

Deck object for workspace. Defaults to None.

TYPE: Deck | None DEFAULT: None

safe_height

safe height in terms of robot coordinate system. Defaults to 240.

TYPE: float | None DEFAULT: 240

saved_positions

dictionary of saved positions. Defaults to dict().

TYPE: dict DEFAULT: None

speed_max

maximum speed of robot in mm/min. Defaults to None.

TYPE: float | None DEFAULT: None

movement_buffer

buffer time for movement. Defaults to None.

TYPE: int | None DEFAULT: None

movement_timeout

timeout for movement. Defaults to None.

TYPE: int | None DEFAULT: None

verbose

whether to output logs. Defaults to False.

TYPE: bool DEFAULT: False

simulation

whether to simulate the robot. Defaults to False.

TYPE: bool DEFAULT: False

isFeasible

isFeasible(
    coordinates: Sequence[float] | ndarray,
    external: bool = True,
    tool_offset: bool = True,
) -> bool

Checks and returns whether the target coordinates is feasible. Also sets the handedness of the robot if necessary.

PARAMETER DESCRIPTION
coordinates

target coordinates

TYPE: Sequence[float] | ndarray

external

whether the target coordinates are in external coordinates. Defaults to True.

TYPE: bool DEFAULT: True

tool_offset

whether to consider the tool offset. Defaults to True.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
bool

whether the target coordinates are feasible

TYPE: bool

setHandedness

setHandedness(
    right_handed: bool, stretch: bool = False
) -> bool

Set the handedness of the robot

PARAMETER DESCRIPTION
right_handed

whether to select right-handedness

TYPE: bool

stretch

whether to stretch the arm. Defaults to False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
bool

whether movement is successful

TYPE: bool

stretchArm

stretchArm() -> bool

Extend the arm to full reach

RETURNS DESCRIPTION
bool

whether movement is successful

TYPE: bool

within_volume

within_volume(point: Sequence[float]) -> bool

Check whether a point is within the robot's workspace

PARAMETER DESCRIPTION
point

3D coordinates of the point

TYPE: Sequence[float]

RETURNS DESCRIPTION
bool

whether the point is within the robot's workspace

TYPE: bool