Client

class aiofranka.client.FrankaClient(hostname, username, password, protocol='http')[source]

Bases: ABC

Low-level client for Franka robot web interface authentication and control.

This abstract base class handles login, logout, control token management, and shutdown operations via the robot’s HTTP/HTTPS API. Used internally by FrankaLockUnlock for brake control and FCI activation.

Parameters:
  • hostname (str)

  • username (str)

  • password (str)

  • protocol (str)

_hostname

Robot hostname with protocol (http:// or https://)

Type:

str

_username

Admin username

Type:

str

_password

Admin password (SHA256 encoded)

Type:

str

_logged_in

Current login state

Type:

bool

_token

Active control token

Type:

str

_token_id

Active control token ID

Type:

int

Note

This is an abstract class. Use FrankaLockUnlock for actual robot control.

Caveats:
  • Only one user can have control token at a time

  • SSL verification disabled by default (self-signed certs)

  • Must login before requesting control token

  • Token expires if not used within timeout period

__init__(hostname, username, password, protocol='http')[source]

Initialize Franka client with credentials.

Parameters:
  • hostname (str) – Robot IP or hostname (e.g., “172.16.0.2”)

  • username (str) – Admin username (typically “admin”)

  • password (str) – Admin password

  • protocol (str) – “http” or “https” (default: “http”)

Note

Password is automatically SHA256 encoded using Franka’s format.

abstractmethod run()[source]
Return type:

None

class aiofranka.client.FrankaLockUnlock(hostname, username, password, protocol='https', relock=False)[source]

Bases: FrankaClient

High-level client for Franka robot brake control and FCI activation.

This class provides methods to lock/unlock robot brakes, activate FCI (Franka Control Interface), and manage control tokens. Essential for preparing the robot before using RobotInterface.

Typical workflow: 1. Create FrankaLockUnlock instance 2. Call run(unlock=True, fci=True, persistent=True) 3. Use RobotInterface for control 4. Cleanup automatically handles relock and logout

Examples

Unlock and activate FCI: >>> client = FrankaLockUnlock(“172.16.0.2”, “admin”, “admin”) >>> client.run(unlock=True, fci=True, persistent=True)

Lock robot: >>> client.run(unlock=False)

Request physical access (requires button press): >>> client.run(unlock=True, request=True, wait=True)

Caveats:
  • Must be called before first use of RobotInterface

  • Use persistent=True to keep token for multiple scripts

  • relock=True automatically locks brakes on exit

  • Physical access requires pressing button on robot

Parameters:
__init__(hostname, username, password, protocol='https', relock=False)[source]

Initialize lock/unlock client.

Parameters:
  • hostname (str) – Robot IP address (e.g., “172.16.0.2”)

  • username (str) – Admin username (default: “admin”)

  • password (str) – Admin password

  • protocol (str) – “http” or “https” (default: “https”)

  • relock (bool) – Automatically lock brakes on exit (default: False)

Note

  • Cleanup handler registered automatically via atexit

  • relock=True is useful for safety but may be unwanted in scripts

run(unlock=False, force=False, wait=False, request=False, persistent=False, fci=False, home=False)[source]
Parameters:
Return type:

None