ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Using ROS to run a TP program on Fanuc

asked 2019-04-23 10:40:32 -0500

ccetin gravatar image

Hello all,

I have a Fanuc LR Mate 200 iC that works with ROS (MoveIt and everything else works). I have a pneumatic schunk end effector attached to the arm and I would like to be able to actuate it using ROS. One easy way to do so could be using a two TP programs one for opening the gripper and the other for closing it and running these programs with a command within ROS.

Is this possible or is it a better way to accomplish this (in a short amount of time)?

I am running ROS Kinetic on Ubuntu 16.04, if that matters.

Thanks.

edit retag flag offensive close merge delete

Comments

1

Which driver are you using?

gvdhoorn gravatar image gvdhoorn  ( 2019-04-23 11:04:50 -0500 )edit

gvdhoorn,

Thanks for the prompt reply and all the work you put into Fanuc packages. I am using the indigo-devel branch of the fanuc_driver. The controller is R30i and the TP version is v7.70P/31.

ccetin gravatar image ccetin  ( 2019-04-23 11:11:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-04-23 11:27:41 -0500

gvdhoorn gravatar image

updated 2019-04-23 15:15:53 -0500

I am using the indigo-devel branch of the fanuc_driver.

First: please use fanuc_driver_exp instead of fanuc_driver (it's a drop-in replacement for the controller side of fanuc_driver).

As to executing TP programs: that is not something that fanuc_driver_exp currently supports (nor fanuc_driver). You could either extend fanuc_driver_exp with such functionality (which should not be terribly difficult, but would be some work in Karel), or perhaps -- if your programs would really just be (re)setting digital or analog IOs -- just control the IOs directly.

For that you could use either a fieldbus integrated with ROS (there are some packages for that, Ethernet/IP, modbus or profinet fi) but you would need fieldbus support on your Fanuc controller (or a PLC) or you could see whether gavanderhoorn/fanuc_ros_cgio_py is sufficiently performant. It is not meant for production use, but for the occasional ON/OFF in a research/hobby setting it might be enough.

There is no ROS node, but the Python library should be easy enough to wrap in a simple node with two services that toggle your IOs.


Edit:

I will update the post if I get the time to try either of the methods. I was hoping there would be a hacky/quick fix type of way of doing this but I guess not.

Not sure whether this would be any faster (as it would still require some programming), but you could potentially use the RSR or PNS system (digital IOs triggering execution of programs) in combination with your short programs to open/close the gripper.

Another alternative: use a PLC with some "easier" interface than digital IOs to control the IO of the gripper.

I saw gavanderhoorn/fanuc_ros_cgio_py before I posted but I don't think I can implement this with the time constraint I have

Literally the only thing missing would be a Python Service Server that exposes two services: open and close.

In open, it calls robot.write_dout(..) with as argument the DOUT that opens your gripper, and in close it calls robot.write_dout(..) with as argument the DOUT that closes your gripper.

Provided your gripper actually works that way, that should be 30 mins work, max.

If your gripper is controlled using ROUT (ie: robot out), you could even check the example.


Edit 2: just came across ABC-iRobotics/fanuc-webcontrol, which contains a program called webstart which can apparently be used to start TP programs by just visiting a URL. Similar to the idea in gavanderhoorn/fanuc_ros_cgio, but one step closer to what you asked for (ie: starting programs).

Would still need wrapping in a ROS node, but that would probably be even easier than with gavanderhoorn/fanuc_ros_cgio_py.

edit flag offensive delete link more

Comments

There could of course be other options / approaches, but this is what I could recommend as a quick fix.

gvdhoorn gravatar image gvdhoorn  ( 2019-04-23 11:30:54 -0500 )edit

I saw gavanderhoorn/fanuc_ros_cgio_py before I posted but I don't think I can implement this with the time constraint I have and I have no experience with Karel for the first suggestion you had. I will update the post if I get the time to try either of the methods. I was hoping there would be a hacky/quick fix type of way of doing this but I guess not.

Thanks a lot for the help!

Edit: I have the necessary packages for the fanuc_ros_cgio_py, I will give that a shot. Thanks again gvdhoorn.

ccetin gravatar image ccetin  ( 2019-04-23 11:41:12 -0500 )edit

The method you suggested in the last edit seems to be working. I can initiate TP programs from the browser. I will write a ROS wrapper to include it in my code.

Thanks a lot!

ccetin gravatar image ccetin  ( 2019-04-25 15:44:48 -0500 )edit

Just for my understanding: the two "small TP programs" you mention, do they (un)set digital IOs?

gvdhoorn gravatar image gvdhoorn  ( 2019-04-26 04:27:30 -0500 )edit

I had other TP programs that might have been useful to run but yes essentially that was the idea. But I think implementing gavanderhoorn/fanuc_ros_cgio for that makes much more sense, so I will do that as well.

edit: implemented gavanderhoorn/fanuc_ros_cgio works as intended.

ccetin gravatar image ccetin  ( 2019-04-26 08:21:27 -0500 )edit

edit: implemented gavanderhoorn/fanuc_ros_cgio works as intended.

would be awesome if you could make your node available. That would benefit future users tremendously.

gvdhoorn gravatar image gvdhoorn  ( 2019-04-30 11:26:10 -0500 )edit

I will make it available once I clean the code up a bit.

On a side note, I ran into some issues trying to run another TP program while ROS is running. It is not letting me run another program with movement in it with the alert "already locked by other task". Any idea on how to resolve this @gvdhoorn?

ccetin gravatar image ccetin  ( 2019-05-02 16:46:59 -0500 )edit

It's considered bad form to post follow-up questions under an answer to an answered question. It's better to post a new question.

But in short: the driver commands motion, so it locks motion groups. You cannot start another program that commands motion while the driver is running (or at least: the trajectory relaying part).

gvdhoorn gravatar image gvdhoorn  ( 2019-05-03 02:19:21 -0500 )edit

Question Tools

Stats

Asked: 2019-04-23 10:40:32 -0500

Seen: 1,316 times

Last updated: Apr 23 '19