From the output above, we know this service is using the message type iri_wam_reproduce_trajectory/ExecTraj. Name of message file is ExecTraj. We can get more information about this service message by running:
user:~$ rossrv show iri_wam_reproduce_trajectory/ExecTraj
We know that to interact with the service programmatically, we need to import:
ExecTraj for creating a connection to the service server, just as we used DeleteModel in Example 3.5
ExecTrajRequest for creating a request to send to the server, also similar to example 3.5
ExecTraj and ExecTrajRequest are available by convention in ROS; once you create and compile the service message. In fact, a third class is available, called ExecTrajResponse…you will learn more about this in Services part 2.
I hope this helps. Please let us know if you require further clarifications.
The code block you quoted above is sending the request object (execute_trajectory_request_object) through the service connection (execute_trajectory_service_client).
This is something similar to what is done in the “DeleteModel” example, Example 3.5
# Create the connection to the service
delete_model_service = rospy.ServiceProxy('/gazebo/delete_model', DeleteModel)
# Create an object of type DeleteModelRequest
delete_model_object = DeleteModelRequest()
# Send through the connection the name of the object to be deleted by the service
result = delete_model_service(delete_model_object)
Again, I hope this helps. Don’t hesitate to ask if you need further clarifications.
Thank you for the answer @bayodesegun. Although, I still don’t understand how to knowexecute_trajectory_service_client , is an object of ExecTrajRequest().
There is nothing that gives me an hint of the actual name of the object to use. I don’t know if i am missing something. I could not but just check the solution for the exercise though completed almost 80% of it on my own.
I was about to ask the same question. This is not clear at all in the course notes (and, therefore, it is almost impossible to finish the exercise without help!). I’d be helpful to add a section in the notes about it.
I have to say I agree with the other comments above. The structure of this exercise is poor and doesn’t work well. The way the information is presented makes it very difficult to understand what should be achieved and how to go about the process.
To make you aware how poor this has been structured I am apart of an MSc cohort. None have been able to grasp the fundamental mechanics of the structure from your instructions or complete the exercise without looking up answers on google or through your forum. Even with the information from your forum it is still very difficult.
We have just added a small section explaining how to use the different parts of a custom message in your program. Please feel free to check it out and lets us know what you think about it. As always, thanks for your feedback.