Respected Professor,
I wonder why am I getting the following error when I execute the roslaunch unit_4_services my_robot_arm_demo.launch code.
I’ve written the following code in .launch file
<include file="$(find iri_wam_reproduce_trajectory)/launch/start_service.launch"/>
<node pkg="unit_4_services"
type="exercise_4_1.py"
name="service_execute_trajectory_client"
output="screen">
</node>
</launch>
And written the following code in .py file
#! /usr/bin/env python
import rospkg
import rospy
from iri_wam_reproduce_trajectory.srv import ExecTraj, ExecTrajRequest
rospy.init_node('service_execute_trajectory_client')
rospy.wait_for_service('/execute_trajectory')
execute_trajectory_service_client = rospy.ServiceProxy('/execute_trajectory', ExecTraj)
execute_trajectory_request_object = ExecTrajRequest()
rospack = rospkg.RosPack()
trajectory_file_path = rospack.get_path('iri_wam_reproduce_trajectory') + "/config/get_food.txt"
execute_trajectory_request_object.file = trajectory_file_path
result = execute_trajectory_service_client(execute_trajectory_request_object)
print result
The code seems to be correct because I’ve corrected it from the solution of exercise 4.1…But, it’s still throwing error