XenseGripper API Reference
| Method | Purpose |
|---|---|
XenseGripper.create(mac_addr=None) | Create a gripper connection |
set_position(position, vmax=80.0, fmax=27.0) | Non-blocking position command, 0–85 mm |
set_position_sync(...) | Command a position and wait for arrival; on timeout, returns False or raises a timeout exception depending on the installed package version |
set_speed(velocity, fmax=27) | Positive closes, negative opens, zero stops |
open_gripper() / close_gripper() | Move to 85 mm / 0 mm |
get_gripper_status() | Return position, velocity, force, and temperature |
set_led_color(r, g, b) | Set RGB LED channels in the 0–255 range |
set_control_param(stiffness, kp, ki, kd) | Configure the SAFE-mode controller |
mode(control_mode, serial_number=None) | Temporarily switch mode with a context manager |
enable_mode(...) / disable_mode() | Manually enable or disable a mode |
Position and velocity limits
gripper.set_position(position=50, vmax=120, fmax=25)
with gripper.mode(XenseGripper.ControlMode.SPEED):
gripper.set_speed(-40)
time.sleep(1)
gripper.set_speed(0)
Current implementations commonly constrain position to 0..85 mm, maximum velocity to 0..350 mm/s, and maximum force to 0..60 N. The exact limits may vary by firmware; if a ValueError is raised, follow the limits reported by the device.
Reading status
status = gripper.get_gripper_status()
if status:
print(status["position"], "mm")
print(status["velocity"], "mm/s")
print(status["force"], "N")
print(status["temperature"], "°C")