Simple FANUC RMI client
Project description
FANUC RMI Client
Python client for FANUC RMI with reusable functions (no CLI entrypoint).
Install (pip)
python3 -m venv .venvsource .venv/bin/activatepip 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 addressstartup_port: startup port, default16001main_port: main port, default16002connect_timeout: seconds for TCP connectsocket_timeout: seconds for socket opsreader_timeout: seconds to wait for a JSON responseattempts: number of retry attemptsretry_delay: seconds between retriesstartup_pause: seconds between startup and main connections
API Overview
RobotClient(...): create a client, no network calls; returns a client instanceRobotClient.connect(): connects to startup, sendsFRC_Connect, then connects to main; prints responses; returnsNoneRobotClient.initialize(uframe=0, utool=1): sendsFRC_Reset,FRC_Initialize,FRC_SetUFrameUTool; prints responses; returnsNoneRobotClient.close(): sendsFRC_Disconnectand closes sockets; returnsNone
Motions (RobotClient)
linear_relative(relative_displacement, speed): linear move relative to current pose;X, Y, Z, W, P, R(mm/deg);speedin mm/s; returnsNonelinear_absolute(absolute_position, speed): linear move to absolute pose;X, Y, Z, W, P, R;speedin mm/s; returnsNonejoint_relative(relative_displacement, speed_percentage): joint move relative;J0..J9;speed_percentageis % of max; returnsNonejoint_absolute(absolute_position, speed_percentage): joint move to absolute;J1..J9;speed_percentageis % of max; returnsNone
Reads (RobotClient)
read_cartesian_coordinates(output_path="./robot_position_cartesian.txt"): sendsFRC_ReadCartesianPosition, prints response, appends formatted pose line; returnsNoneread_joint_coordinates(output_path="./robot_position_joint.txt"): sendsFRC_ReadJointAngles, prints response, appends formatted joint line; returnsNonerequest_current_position(): sendsFRC_ReadCartesianPositionand returns the raw response dict
Output Files
robot_position_cartesian.txt: created automatically when reading Cartesian posesrobot_position_joint.txt: created automatically when reading joint poses
Notes
- Requires Python 3.11+.
- If you cloned the repo,
main.pyis 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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f36f4e636cf0b264d378c71cdd0ed7f6730632607777c3c18a454cacf7bfc6e
|
|
| MD5 |
9cf367b26a0b38d5022851a2e61ebcf9
|
|
| BLAKE2b-256 |
e5ad1c4b69a5b4b088042cd46f410f4225d0989b4801cd85c028640f4f124a2b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d0839187a6cf5f8cdee7495aeb5d3ec3cdd0ef23991577afc52411c112c3891
|
|
| MD5 |
438d90d6c725857d08cd45357fe723d3
|
|
| BLAKE2b-256 |
687e77d925bee851296673b2749ee551fa5b571211c8fd77ebfb97f18a897518
|