Skip to main content

Simple FANUC RMI client

Project description

FANUC RMI Client

Python client for FANUC RMI with reusable functions (no CLI entrypoint).

Install (pip)

  1. python3 -m venv .venv
  2. source .venv/bin/activate
  3. pip install fanuc-rmi

Quick Start

from fanuc_rmi import RobotClient

client = RobotClient(
    host="192.168.1.22",
    socket_timeout=100.0,
    reader_timeout=100.0,
)

client.connect()
client.initialize(uframe=0, utool=1)

absolute_position = {"J1": 63.252, "J2": 31.488, "J3": -35.602, "J4": 18.504, "J5": -101.313, "J6": 108.650, "J7": 0.000, "J8": 0.000, "J9": 0.000}
client.joint_absolute(absolute_position, speed_percentage=40)

client.close()

Configuration (RobotClient args)

  • host: controller IP address
  • startup_port: startup port, default 16001
  • main_port: main port, default 16002
  • connect_timeout: seconds for TCP connect
  • socket_timeout: seconds for socket ops
  • reader_timeout: seconds to wait for a JSON response
  • attempts: number of retry attempts
  • retry_delay: seconds between retries
  • startup_pause: seconds between startup and main connections

API Overview

  • RobotClient(...): create a client, no network calls; returns a client instance
  • RobotClient.connect(): connects to startup, sends FRC_Connect, then connects to main; prints responses; returns None
  • RobotClient.initialize(uframe=0, utool=1): sends FRC_Reset, FRC_Initialize, FRC_SetUFrameUTool; prints responses; returns None
  • RobotClient.close(): sends FRC_Disconnect and closes sockets; returns None

Motions (RobotClient)

  • linear_relative(relative_displacement, speed): linear move relative to current pose; X, Y, Z, W, P, R (mm/deg); speed in mm/s; returns None
  • linear_absolute(absolute_position, speed): linear move to absolute pose; X, Y, Z, W, P, R; speed in mm/s; returns None
  • joint_relative(relative_displacement, speed_percentage): joint move relative; J0..J9; speed_percentage is % of max; returns None
  • joint_absolute(absolute_position, speed_percentage): joint move to absolute; J1..J9; speed_percentage is % of max; returns None

Reads (RobotClient)

  • read_cartesian_coordinates(output_path="./robot_position_cartesian.txt"): sends FRC_ReadCartesianPosition, prints response, appends formatted pose line; returns None
  • read_joint_coordinates(output_path="./robot_position_joint.txt"): sends FRC_ReadJointAngles, prints response, appends formatted joint line; returns None
  • request_current_position(): sends FRC_ReadCartesianPosition and returns the raw response dict

Output Files

  • robot_position_cartesian.txt: created automatically when reading Cartesian poses
  • robot_position_joint.txt: created automatically when reading joint poses

Notes

  • Requires Python 3.11+.
  • If you cloned the repo, main.py is a runnable example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fanuc_rmi-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fanuc_rmi-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file fanuc_rmi-0.1.1.tar.gz.

File metadata

  • Download URL: fanuc_rmi-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fanuc_rmi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1f36f4e636cf0b264d378c71cdd0ed7f6730632607777c3c18a454cacf7bfc6e
MD5 9cf367b26a0b38d5022851a2e61ebcf9
BLAKE2b-256 e5ad1c4b69a5b4b088042cd46f410f4225d0989b4801cd85c028640f4f124a2b

See more details on using hashes here.

File details

Details for the file fanuc_rmi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fanuc_rmi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fanuc_rmi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d0839187a6cf5f8cdee7495aeb5d3ec3cdd0ef23991577afc52411c112c3891
MD5 438d90d6c725857d08cd45357fe723d3
BLAKE2b-256 687e77d925bee851296673b2749ee551fa5b571211c8fd77ebfb97f18a897518

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page