0
$\begingroup$

Rosanswers logo

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 the interface file for 'navigate':

publishers: 
  - scan
  - /tf
  - tf_changes
  - /tf_changes
  - map
  - amcl_pose
  - move_base/TrajectoryPlannerROS/global_plan
subscribers: 
  - mobile_base/commands/velocity
  - initialpose
  - /initialpose
  - move_base_simple/goal
  - /move_base_simple/goal
  - move_base/goal
  - /move_base/goal
  - /move_base/goal/goal
services: 
  - save_map
  - rename_map
  - delete_map
  - load_map_db
  - list_map

EDIT 2: Some python:

def init_fn():
    global client, db, collection, grid, map_pub, meta_pub
    rospy.init_node('turtlebot_db', anonymous=True)
    map_pub = rospy.Publisher('map', OccupancyGrid, latch=True)
    meta_pub = rospy.Publisher('map_metadata', MapMetaData, latch=True)
      rospy.Service('load_map_db', MapPublish, map_load)
      rospy.spin()
     
def map_load(req):
    #
    global map_pub, meta_pub
    #
    whole_map = MapWithMetaData()
    whole_map = collection.find_one({ 'info.map_id' : req.map_id })
    if whole_map == None :
        return ['badmap']
    ##
    ## SOME BORING STUFF HERE...
    ##
   
    map_pub.publish(oldmap)
    meta_pub.publish(oldmap.info)
    #
    return ['done']

Originally posted by david.c.liebman on ROS Answers with karma: 125 on 2014-03-14

Post score: 1


Original comments

Comment by david.c.liebman on 2014-03-15:
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

Comment by Daniel Stonier on 2014-03-15:
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

Comment by Daniel Stonier on 2014-03-15:
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.

Comment by david.c.liebman on 2014-03-17:
I have added my python (which may be the problem) to the original question.

Comment by Daniel Stonier on 2014-03-17:
Is it a case of not having used wait_for_service before calling the service?

Comment by david.c.liebman on 2014-03-18:
how does one 'wait_for_service' with rosbridge server? I googled to no avail.

Comment by jihoonl on 2014-03-18:
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

Comment by Daniel Stonier on 2014-03-18:
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.

Comment by david.c.liebman on 2014-03-19:
yes, in fact a ten sec wait removed the error. (on two tests so far.)

Comment by Daniel Stonier on 2014-03-19:
aha, bingo :)

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I have had similar problems when using rosbridge. Be sure that the terminal you are launching rosbridge in knows about your service files and custom nodes. In other words, do this:

cd /path/to/my/catkin/workspace

source devel/setup.bash

rospack profile

roslaunch rosbridge_server rosbridge_websocket.launch


Originally posted by rtoris288 with karma: 1173 on 2014-03-16

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by david.c.liebman on 2014-03-16:
rospack profile didn't change my experience. The devel/setup.bash file is loaded correctly.

Comment by david.c.liebman on 2014-03-18:
I tried this twice just to be sure. I didn't see a change when I ran the above commands. Truthfully I don't understand quite what is intended with the commands. I have some srv files that work, so how do I tell which ones rosbridge doesn't see from the command line?

$\endgroup$
0
$\begingroup$

Rosanswers logo

I don't know if this is similar one as the issue reported in rosbridge_suite. https://github.com/RobotWebTools/rosbridge_suite/issues/85

rostopic python module had a problem with returning the right topic type if the topic does not exist. Could service as well?


Originally posted by jihoonl with karma: 634 on 2014-03-16

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by david.c.liebman on 2014-03-17:
would that mean that though '/app_manager/application/load_map_db' doesn't work, that if I change things around that '/load_map_db' by itself would work?? This is not the case. If I launch the python support code outside the rapp, I still get an error. '/load_map_db' service does not exist then.

Comment by david.c.liebman on 2014-03-17:
AND I have to think that all this should come back to the fact that I have other services that do work. If it's a runtime error, where is the fault, in the javascript or the python?? I should look there.

Comment by david.c.liebman on 2014-03-17:
could it be the problem you say and still some of my services work?

Comment by jihoonl on 2014-03-17:
Well. One of possibility. Not sure though. I would test service itself without rosbridge first to confirm service works fine. Then test with rosbridge connection. If service works without rosbridge properly, then it obviously tells that something is going on with rosbridge.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.