Now that we have Rotrics DexArm, let's run it with the python API. I use Rotrics Studio to adjust the arm position.
I got pydexarm.py
from the Rotrics Repository and placed it in my working directory.
Describe the operation with reference to pydexarm.py
and ʻexample.py. In the argument of
Dexarm`, enter the assigned port.
You can find the port on the Rotrics Studio connection screen or in Device Manager's USB serial device.
demo.py
from pydexarm import Dexarm
def main():
dexarm = Dexarm("COM3") #Connected port number
dexarm.go_home()
dexarm.move_to(350, 0, 0)
dexarm.move_to(350, 0, -50)
dexarm.soft_gripper_pick()
dexarm.move_to(350, 0, 100)
dexarm.move_to(350, 0, -50)
dexarm.soft_gripper_nature()
dexarm.move_to(350, 0, 0)
dexarm.go_home()
if __name__ == "__main__":
main()
Recommended Posts