ysl208 / iRoPro

iRoPro on Baxter
MIT License
3 stars 0 forks source link

Activate Freedrive mode via Editor for UR5 #52

Open ysl208 opened 3 years ago

ysl208 commented 3 years ago

For the UR5, the freedrive mode can only be activated via the teach pendant (by holding the button).

ysl208 commented 3 years ago

Run it from the python command line similar to using a short script: python

import urx
timeout = 1000
rob=urx.Robot("robot_ip", True)

rob.send_program("def myProg():\n\tfreedrive_mode()\nsleep({})\nend".format(timeout)) # start free drive

To exit freedrive mode, run rob.send_program('end_freedrive_mode()')

ysl208 commented 3 years ago

To integrate it into iRoPro, I'd recommend writing a separate python script, which uses rospy and listens to a rostopic. In iRoPro, add an action client that publishes to this rostopic when it needs to freeze or unfreeze (i.e. exit/enter freedrive).