Respected community,
This is a pic of exercise 2.7 that’s asked
Now, I solved it by writing the code below
-
For call_map_service.py file:
#! /usr/bin/env pythonimport rospy
from std_srvs.srv import Empty, EmptyRequestrospy.init_node(‘map_server’)
rospy.wait_for_service(’/static_map’)
get_map_data_service = rospy.ServiceProxy(’/static_map’, Empty)
get_map_data_object = EmptyRequest()
result = get_map_data_service(get_map_data_object)
print result -
For .launch file:
<node pkg="map_server" type="map_server" name="map_server" output="screen" args="/home/user/catkin_ws/src/my_map.yaml"/>
And then I launched it using roslaunch get_map_data map_data.launch command. In the next shell, I called using rosservice call /static_map “{}”.
Below was the output
Everything went smooth without error, BUT, I’m feeling like I didn’t do it the way it was asked to or the way I was supposed to do.
Would you tell me what’s missing and how can I correct it ?
The expected output for this exercise is not written, So I can’t compare it.
The reason I have the feelings that it’s not what I was supposed to do is that it’s output is exactly the same as the exercise 2.5. And I wondered what was the objective of the exercise. Or what was the takeaway from it.