hemstreet / RobotArm-6DOF

Controlling Robot arms with python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Robot Arm Controls with Python

Raspberry Pi host using PCA9685 as an I2C 16 bit PWM driver to control the robot arm's Tower MG996R Servos In order to get this working, you may need to customize the limits / bounds for each servo so it will be tuned to your application

For terminal control

$ python 
>>> from Robot import Robot
>>> robot = Robot()

Now in that same python repl we can now access the robot and call module's methods to control such as:

>>> robot.hand.open()
>>> robot.hand.close()
>>> robot.servo.move_servo_to_percent(0,0)
>>> robot.servo.move_servo_to_percent(0,100)
>>> robot.servo.move_servo_to_percent(4, 0)
>>> robot.servo.move_servo_to_percent(4, 100)

Snipped from the example.py code in the root package

from Robot import Robot
from time import sleep

# invoke a new robot
robot = Robot()

# open the hand
robot.hand.open()

sleep(1)

# close the hand
robot.hand.close()

About

Controlling Robot arms with python


Languages

Language:Python 100.0%