Dear Instructor,
I have a couple of doubts regarding the exercise in ROS Topics section:
#! /usr/bin/env python
import rospy
from iri_wam_reproduce_trajectory.srv import ExecTraj, ExecTrajRequest # Import the service message used by the service /execute_trajectory
rospy.init_node('service_execute_trajectory_client') # Initialise a ROS node with the name service_client
rospy.wait_for_service('/execute_trajectory') # Wait for the service client /execute_trajectory to be running
execute_trajectory_service_client = rospy.ServiceProxy('/execute_trajectory', ExecTraj) # Create the connection to the service
execute_trajectory_request_object = ExecTrajRequest() # Create an object of type ExecTrajRequest
execute_trajectory_request_object.file = "file_path" # Fill the variable file of this object with the desired file path
result = execute_trajectory_service_client(execute_trajectory_request_object) # Send through the connection the path to the trajectory file to be executed
print(result) # Print the result type ExecTrajResponse
user:~/catkin_ws$ rossrv show iri_wam_reproduce_trajectory/ExecTraj
string file
---
Here, my question is, how do we know that ExecTraj
is present in the iri_wam_reproduce_trajectory.srv
file?
and the package unit_5_services has dependencies rospy
and iri_wam_reproduce_trajectory
, so the dependencies are other packages? or pieces of code? I do not have a clear understanding of dependencies. If you could help me out explaining it would be great. Thanks!