service does not exist - app_manager rapp, hydro, python, turtlebot
I am using the app_manager and three rapps. In one, the navigate rapp, I get this message when I try to use a service of my own.
[ERROR] [WallTime: 1394827317.221882] [Client 0] [id: call_service:/app_manager/application/load_map_db:7] call_service InvalidServiceException: Service /app_manager/application/load_map_db does not exist
why would the app manager tell me that this is non existant? I am running hydro on a ubuntu 12.04 system. I'm pretty sure it's there, in the srv folder there's a MapPublish.srv file, and in CMakeLists.txt there's an entry for the srevice in the 'add_service_files' section. Everything compiles right. Other services that Ive written work. What have I done wrong? I thought it was some kind of naming problem, but I think the names I've chosen are somewhat original. Any help would be appreciated. I can add more info if requested.
EDIT 1: My project works like this: I have a turtlebot and I use an internet service to transmit direction info from one computer to another, then through the chrome web browser, websockets and rosbridge server to the turtlebot. I have several services that I've authored that help me out. So far that works. I have also tried to implement amcl and gmapping functions that I try to start and stop remotely. I use the app_manager and three rapps. One rapp is for teleop, one for gmapping, and one for amcl.
I should provide documents showing some of these functions, but the idea is that the rosbridge server stuff tells the app_manager stuff to start and stop different launch files, allowing for this different functionality. This is why my service 'load_map_db' is preceded by the '/app_manager/application/'. What I don't do, is use the rocon launcher. Everything runs on the same port and there's no need to switch (I think they call it flip) from one port to another. I do use the app_manager 'start_app' and 'stop_app'.
I thought briefly that the rosbridge server didn't know about the app_manager navigation services because they weren't started when the rosbridge server was started. This didn't pan out. I restarted the rosbridge server stuff as well as I could in javascript at the time that the load_map_db service was used and there was no change.
I don't understand how some of the services work (like 'list_maps') but this one doesn't. Long ago you could have inserted a control character into a file or file name and not know it. Maybe I have done this? I suspect today's text editors will not let you do this. Below I include some source material.
This is my launch file for the whole program:
<launch>
<arg name="rapp_lists" default="tele_presence/tele_presence_apps.rapps"/>
<include file="$(find tele_presence)/launch/includes/app_manager_rocon.launch.xml">
<arg name="rapp_lists" value="$(arg rapp_lists)" />
</include>
<include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch"/>
</launch>
This is my rapps file:
apps:
- tele_presence/mapping
- tele_presence/navigate
- tele_presence/teleop
This is ...
Should I add that I am using ROSBRIDGE SERVER? Does anyone follow questions about rosbridge server? I am using v.2, and the tutorial at this site: http://wiki.ros.org/roslibjs/Tutorials/BasicRosFunctionality
That's a runtime error. Probably it built the .srv quite fine, but the error message there is saying the runtime service does not exist at `/app_manager/application/load_map_db does`. Use `rosservice list` to figure out where your service is, or backtrack to figure out why your service did not start
You might want to add more info about how you're using the rosbridge server. Hard to say whether it is relevant or not given just that information.
I have added my python (which may be the problem) to the original question.
Is it a case of not having used wait_for_service before calling the service?
how does one 'wait_for_service' with rosbridge server? I googled to no avail.
hm... seems like wait for service is not supported by roslibjs and rosbridge yet. I have opened an issue in roslibjs repo. We can continue to discuss there. https://github.com/RobotWebTools/roslibjs/issues/70
You could probably verify that it is indeed the problem by just putting a sleep of some sorts in your program for n seconds before calling the service. If there's no error, then you know it's just your service client calling the server before it's been constructed on the other side.