I am going through this Unit and doing the exercise at the end. While creating the service, I found out that in the example given in the course there was a line that I did not understand in the python file: simple_service_client.py
the following: from trajectory_by_name_srv.srv import TrajByName, TrajByNameRequest
I went to the supposed package on the terminal:
roscd trajectory_by_name_srv; ls srv
with this, I found the TrajByName.srv file that we are importing.
However, I could not find the request “TrajByNameRequest”.
I understand that this is the object that we send to the service server aka request. But, I do not know where that naming came from.
Is it something that is created directly with the python file?
Can I name it whatever I want?
Yeah, you can’t find the TrajByNameRequest because this file is generated by the compilation system using the trajectory_by_name.srv . Compiling a service file generates all the request and response versions of python objects including the TrajByName python object. Thats why you cant find it explicitly. Have a look at the custom message generation section for services to understand this concept further