Hello, I'm trying to run an object on Python with ROS. When I run the code with a variable inside the object:
class lk(old_image):
....then some code
def main(args):
rospy.init_node('lk', anonymous=True)
old_image = lk(old_image)
try:
rospy.spin()
except KeyboardInterrupt:
print "Shutting down"
#cv.DestroyAllWindows()
Traceback (most recent call last):
File "/home/aadejare/ros/omnisensor/nodes/lk.py", line 12, in <module>
class lk(old_image):
However when I get rid of the variable inside the class I then get:
Traceback (most recent call last):
File "***", line 67, in <module>
main(sys.argv)
NameError: name 'main' is not defined
What would be the cause of the NameError? I tried putting in the old_image variable as a global but the same thing occurs except it identifies the variable as global. Thanks for the help