Hello everyone.
First of all, I want to tell everyone that I’m just starting out with ROS and that this is my first post on the forum. I think this will be noticed, so I apologize in advance if my question is not formatted correctly or is not in the right place. Please let me know so I can improve future posts on this forum.
My situation is the following:
• ROS Fundamentals Course in 5 days (Python)
• Unit 5 Understanding ROS services - Clients
I would like to know how I can call the /execute_trajectory service from the terminal, once it has been previously launched from another terminal of course.
My actions are as follows:
The node that provides the /execute_trajectory service is iri_wam_reproduce_trajectory so I look at the structure of this package using:
roscd iri_wam_reproduce_trajectory
ls
I see that there is a launch folder where the start_service.launch file is to launch the node. There is a config folder with three .txt files get_food.txt, init_pos.txt and release_food.txt (with the coordinates of the trajectories to be followed by the WAM robot when it is called by another node) and there is the srv folder where the ExecTraj.srv service message file is. This message file contains:
string file
---
What I understand, as explained in the course, is that to call the /execute_trajectory service, it is necessary to pass as a call parameter a file (of the three that are in the config folder above) to specify which trajectory I want the robotic arm to execute.
I launch the /execute_trajectory service using:
roslaunch iri_wam_reproduce_trajectory start_service.launch
The service starts perfectly waiting for someone to call it.
from another terminal
With all this, I run to call the service /execute_trajectory with the trajectory for example of get_food.txt (with the help of [TAB]+ [TAB] of course) using
rosservice call /execute_trajectory "file:'get_food.txt'"
but I get an error:
ERROR: service [/execute_trajectory] responded with an error: b’’
And in the terminal where I launched the service a message appears telling me that it cannot open the file get_food.txt (Unable to open file [get_food.txt]
Please, if someone could tell me where the error in my approach is. Thank you all very much!!!







