the terminator report Name error :'global name : 'AddTwoIntsResponse' is not defined'.
I am leaning ROS,and my distribution is Indigo,when I followed the tutorials.When I run the rosrun beginner_tutorials add_two_ints_client.py
I encountered this error:Name error:global name:'AddTwoIntsResponse' is not defined
.But
I do find the AddTwoIntsResponse class at line 115:~/catkin_ws/devel/lib/python2.7/dist-packages/beginner_tutorials/srv/_AddTwoInts.py
,why do this happens?
I am encountering the same error. Did you ever figure this out?
Sorry, It's too long time ago. I can't remember the details about how to figure it out. But I think it is related to multiple versions of python on one PC. When you edit
py
files, make sure it is always using python interpreterpython2.7
. You can have a try.If it stills acts badly, you can have another thread to ask about this. I am still confused. Maybe some onther guy will give you an answer.
Thanks for your response.
In my case I needed to alter my import statement in the service.py to
from (package_name).srv import *
. I had changed this line earlier while debugging a different problem.