🐷

FAIRINOをPythonで動かす

2025/03/12に公開

前回のあらすじ

  • ブラウザアプリでFAIRINOを動かしてみた

https://zenn.dev/qiitatomayotta/articles/bea7acbac455ef

PC環境

  • Ubuntu 22.04

Python SDKで動かす

1. ライブラリを導入

  • 以下のページのfairinoディレクトリを実行ファイルの隣に置く

https://github.com/FAIR-INNOVATION/fairino-python-sdk/tree/main/linux

2. MoveJでロボットを動かす

  • 以下の2つの姿勢を繰り返すコードを作成しました.
test.py
from fairino import Robot

robot = Robot.RPC('192.168.58.2')
joint_pos1 = [-83.24, -96.476, 93.688, -114.079, -62, -100]
joint_pos2 = [-43.24, -70.476, 93.688, -114.079, -62, -80]
tool = 0 # Tool number
user = 0 # Workpiece number

while True:
    robot.MoveJ(joint_pos1, tool, user)
    robot.MoveJ(joint_pos2, tool, user)
  • SDK读取机器人实时数据失败 [Errno 9] Bad file descriptorとエラーが出てしまいますが,ちゃんと動きました

参考

https://nagayamas.jp/fairino/
https://fairino-doc-ja.readthedocs.io/latest/index.html

Discussion