7.2.5 Coordinate Control

Coordinates use the array format [X, Y, Z, RX, RY, RZ]. Read the current position first, then make small changes within a safe range.

1. Read Current Coordinates

from pymycobot import MyCobot280

mc = MyCobot280(unoq_bridge=True)
coords = mc.get_coords()
print(coords)

If an empty list or error frame is returned, troubleshoot communication before sending coordinate motion.

2. Send Complete Coordinates

import time
from pymycobot import MyCobot280

mc = MyCobot280(unoq_bridge=True)
coords = mc.get_coords()
if len(coords) != 6:
    raise RuntimeError("Valid coordinates were not read")

# Raise Z by 10 mm from the current position.
target = coords[:]
target[2] += 10
mc.send_coords(target, 20, 1)
time.sleep(3)

In send_coords(coords, speed, mode), mode=0 uses an angular path and mode=1 uses a linear path. Confirm that the target pose is reachable and does not collide with the table, base, or accessories.

3. Coordinate Jog

# Jog in the positive X direction at speed 20.
mc.jog_coord(1, 1, 20)

# Stop jogging.
mc.stop()

Coordinate IDs 1-6 correspond to X, Y, Z, RX, RY, and RZ. Jog control requires a reliable stop operation.

Previous: Joint Control | Back to Python Development | Next: Gripper and Pump

results matching ""

    No results matching ""