Simple FANUC RMI client
Project description
FANUC RMI Client
Python client for FANUC RMI with reusable functions.
Install
python3 -m venv .venv
source .venv/bin/activate
pip install fanuc-rmi
Quick Start
from fanuc_rmi import RobotClient
robot = RobotClient(host="192.168.1.22", startup_port=16001, main_port=16002)
robot.connect()
robot.initialize(uframe=0, utool=1)
active = robot.get_uframe_utool()
robot.close()
Motion Commands
All motion methods accept uframe and utool arguments (defaults are 1 and 1).
# set speed override (controller-specific range)
robot.speed_override(50)
# wait in seconds (uses sequence_id for ordering)
robot.wait_time(2.5, sequence_id=5)
# linear relative motion (mm / deg)
relative_displacement = {"X": 100, "Y": 0, "Z": 0, "W": 0, "P": 0, "R": 0}
robot.linear_relative(relative_displacement, speed=500, sequence_id=1, uframe=1, utool=1)
# linear absolute motion (mm / deg)
absolute_position = {
"X": 491.320, "Y": -507.016, "Z": 223.397,
"W": -179.577, "P": 52.380, "R": -93.233,
}
robot.linear_absolute(absolute_position, speed=300, sequence_id=2, uframe=1, utool=1)
# joint relative motion (deg)
relative_joints = {"J1": 0, "J2": 0, "J3": 0, "J4": 0, "J5": 0, "J6": 0, "J7": 0, "J8": 0, "J9": 0}
robot.joint_relative(relative_joints, speed_percentage=40, sequence_id=3, uframe=1, utool=1)
# joint absolute motion (deg)
absolute_joints = {
"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,
}
robot.joint_absolute(absolute_joints, speed_percentage=40, sequence_id=4, uframe=1, utool=1)
Read APIs
# current pose (also appends to local txt files)
cartesian = robot.read_cartesian_coordinates() # ./robot_position_cartesian.txt
joints = robot.read_joint_coordinates() # ./robot_position_joint.txt
# active frame/tool selection on controller
active = robot.get_uframe_utool()
# frame/tool data records
uframe_1 = robot.read_uframe_data(1)
utool_1 = robot.read_utool_data(1)
robot.write_uframe_data(2, {"X": 0, "Y": 0, "Z": 0, "W": 0, "P": 0, "R": 0})
robot.write_utool_data(3, {"X": 10, "Y": 0, "Z": 120, "W": 0, "P": 0, "R": 0})
UFRAME / UTOOL Numbering
UFRAMEselection supports0..9.UFRAME 0is the controller default/world frame (valid to select/use).FRC_ReadUFrameData/FRC_WriteUFrameDatashould use1..9. Using0may return an error.UTOOLselection is1..9on this setup.- No practical
UTOOL 0is used in this project.
Notes
- Requires Python 3.11+.
main.pyis a runnable example script.
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.2.0.tar.gz
(7.1 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.2.0.tar.gz.
File metadata
- Download URL: fanuc_rmi-0.2.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1a064cb271f4cfc3d50b9128cc24733ae40fc39eeee3b6a0ec34101dbeb00b6
|
|
| MD5 |
dc693f454eb66a5259d5347cd9734663
|
|
| BLAKE2b-256 |
15e9c24428300f55592a269176dcffed7393a135eb7a358ffeee8ff09fd3bf0d
|
File details
Details for the file fanuc_rmi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fanuc_rmi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
249a9b061c4ea7f9546107ffb6f229b6d46b3aba373f025f4c47c84cfe703b29
|
|
| MD5 |
4bb9ded1ccb50dc1164cac2b7b52c6d4
|
|
| BLAKE2b-256 |
e7fdb57851fceae9beca1b8bc2d6e3f4818213e1c960ab520628afe672ec8011
|