Referencing constants in .srv from Python
Given the file:
foo.srv
string service_name = foo_service string in --- string out
In my C++ code, my_project::foo::Request::service_name
works as expected, but how do I do this in Python? I do:
from my_project.srv import foo
at the head of the file, but in the code foo.service_name
, fooRequest.service_name
, foo.fooRequest.service_name
all fail. I can see service_name = 'foo_service'
in the generated _foo.py
file, so I think it's a problem in my code, not my build process.