Rosbag and python script fail due to GetPlan service
Hello guys,
I have recorded a rosbag
during my last experiment and I want to replay it. At the same time I want to run an implemented algorithm in python in order to compare the results with the results of the previous algorithm have already been computed based on the rosbag
mentioned above.
However, when I run both rosbag play my_rosbag.bag
and rosrun script.py
I get the following error :
resp = get_plan(srv.start, srv.goal, srv.tolerance)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in __call__
return self.call(*args, **kwds)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 495, in call
service_uri = self._get_service_uri(request)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 463, in _get_service_uri
raise ServiceException("service [%s] unavailable"%self.resolved_name)
rospy.service.ServiceException: service [/move_base/GlobalPlanner/plan] unavailable
Inside the python script there is a path calculation using GetPlan
service. If I remove it, the algorithm runs effectively. But I want to take it into account without failing.
Has anyone ever experienced a similar situation to that ?
rosbag
does not (re)create service servers. If you don't startmove_base
, theplan
service will not be available, hence the error.Thanks for the answer. It does make sense, but I think I am missing something. Do I have to run an existing launch file related to
move_base
(such asmove_base.launch
) in an extra terminal alongsiderosbag
andscript.py
or create a new specific launch file ?