SintefManufacturing / python-urx

Python library to control a robot from 'Universal Robots' http://www.universal-robots.com/
GNU Lesser General Public License v3.0
526 stars 275 forks source link

Error implementing get_robot.py #67

Open sakshirawal14 opened 5 years ago

sakshirawal14 commented 5 years ago

Hi I encountered the following error on executing the get_robot.py robot.close() NameError: name 'robot' is not defined

Here is the code: import urx from IPython import embed import logging

if name == "main": try: logging.basicConfig(level=logging.INFO)

robot = urx.Robot("192.168.1.6")

    robot = urx.Robot("192.168.1.100")
    #robot = urx.Robot("localhost")
    r = robot
    print("Robot object is available as robot or r")
    embed()
finally:
    robot.close()

Any leads are highly appreciated Thanks