GripperController
Robotiq Gripper Interface for aiofranka
This module provides an async wrapper for Robotiq grippers, following the same design pattern as FrankaController - a background control loop continuously sends commands while you update the target position.
Requires optional dependencies: pip install “aiofranka[robotiq]”
Example
>>> import asyncio
>>> from aiofranka.gripper import GripperController
>>>
>>> async def main():
... gripper = GripperController("/dev/ttyUSB1")
... await gripper.start()
... gripper.speed = 128 # Set speed (like kp/kd)
... gripper.q_desired = 200 # Set target position
... await asyncio.sleep(1)
... await gripper.stop()
>>>
>>> asyncio.run(main())
- class aiofranka.gripper.GripperController(port='/dev/ttyUSB1', speed=255, force=255, loop_rate=50.0, read_every_n=2)[source]
Bases:
objectAsync gripper controller with background control loop.
Similar to FrankaController, this runs a background loop that continuously sends goTo commands. You only need to set the target position - the loop handles the communication.
- Parameters:
Example
>>> gripper = GripperController("/dev/ttyUSB1") >>> await gripper.start() >>> >>> # Set gains (speed/force) like you set kp/kd >>> gripper.speed = 128 >>> gripper.force = 200 >>> >>> # Set target position (like q_desired for Franka) >>> gripper.q_desired = 255 # Close >>> await asyncio.sleep(0.5) >>> gripper.q_desired = 0 # Open >>> await asyncio.sleep(0.5) >>> >>> # Read current position (like qpos for Franka) >>> print(gripper.qpos) >>> >>> await gripper.stop()
- set_freq(freq)[source]
Set the update frequency for rate-limited set() calls.
- Parameters:
freq (float) – Desired update frequency in Hz (typically 10-100 Hz)
- async set(attr, value)[source]
Rate-limited setter (same pattern as FrankaController).
- Parameters:
attr (str) – Attribute name (“q_desired”, “speed”, “force”)
value – Value to set