Quick start

Run these examples in an environment where the dobot package is installed. Before commanding physical motion, verify the robot IP address, workspace, and emergency-stop procedure. The first example only reads state.

See MG400 Hardware for network and pre-operation checks.

from dobot.dobot_ctrl import DobotCtrl

robot = DobotCtrl(dobot_ip="192.168.1.6")
try:
    print(robot.get_current_position())
    print(robot.get_current_angle())
    print(robot.servo_on)
finally:
    robot.disconnect()

DobotCtrl delegates to DobotTcp. The default auto_connect=True attempts to connect during construction. Set auto_connect=False to construct without connecting.

Continue with local control and server startup.