Skip to content

mf093087/fanucpy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fanucpy: Python package for FANUC industrial robots

Acknowledgements

This work was developed at the Institute for Advanced Manufacturing at the University of Nottingham as a part of the Digital Manufacturing and Design Training Network.

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 814078.

Software contents

The package consists of two parts:

  1. Robot interface code written in Python programming language
  2. FANUC robot controller driver (tested with R-30iB Mate Plus Controller) written in KAREL and FANUC teach pendant languages

The communication protocol between the Python package and the FANUC robot controller is depicted below: Communication Protocol

Python package installation

pip install fanucpy

Driver installation

Follow these steps to install FANUC driver.

Usage

Connect to a robot:

from fanucpy import Robot

robot = Robot(
    robot_model="Fanuc",
    host="192.168.1.100",
    port=18735,
    ee_DO_type="RDO",
    ee_DO_num=7,
)

robot.connect()

Moving

# move in joint space
robot.move(
    "joint",
    vals=[19.0, 66.0, -33.0, 18.0, -30.0, -33.0],
    velocity=100,
    acceleration=100,
    cnt_val=0,
    linear=False
)

# move in cartesian space
robot.move(
    "pose",
    vals=[0.0, -28.0, -35.0, 0.0, -55.0, 0.0],
    velocity=50,
    acceleration=50,
    cnt_val=0,
    linear=False
)

Opening/closing gripper

# open gripper
robot.gripper(True)

# close gripper
robot.gripper(False)

Querying robot state

# get robot state
print(f"Current pose: {robot.get_curpos()}")
print(f"Current joints: {robot.get_curjpos()}")
print(f"Instantaneous power: {robot.get_ins_power()}")

RobotApp

We introduce an experimental feature: Robot Apps. This class facilitates modularity and plug-and-produce functionality. Check the following example apps:

  1. Pick and Place App
  2. Aruco Tracking App

About

Python Interface for FANUC robots

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.9%
  • LiveScript 9.1%