service does not exist -- don't know why

144 views
Skip to first unread message

David Liebman

unread,
Mar 15, 2014, 12:23:22 PM3/15/14
to rosbrid...@googlegroups.com
HI. I really like rosbridge, bye the way. Here is my big problem.

Here is some javascript that I am trying to get to work. It uses roslibjs, v2, I think. It doesn't work. The error message I get follows.

    ros = new ROSLIB.Ros({
        url : 'ws://localhost:9090'
      });
   
    map_service_load = new ROSLIB.Service({
        'ros' : ros,
        'name' : app_manager_prefix + rootname +
        '/load_map_db',
            serviceType : 'tele_presence/MapPublish'
      });
     
      var request = new ROSLIB.ServiceRequest({ "map_id": commands.id});
    map_service_load.callService( request, function (result) {
        console.log(result.message);
        sendMapBroadcast(commands.wizard, null, 0);
    } );

     
Here is the error message:

[ERROR] [WallTime: 1394898248.958051] [Client 0] [id: call_service:/app_manager/application/load_map_db:12] call_service InvalidServiceException: Service /app_manager/application/load_map_db does not exist

     
Here is some python that the service should call. It's boring and long, but I want to be as complete as possible:

     
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']


catkin_make finishes cleanly. Here is a snippet from CMakeLists.txt:

add_service_files(
   FILES
   CreateMap.srv
   PictureMap.srv
   BasicLaunch.srv
   BasicStop.srv
  
  
   MapSave.srv
   MapLoad.srv
   MapPublish.srv
   MapRename.srv
   MapList.srv
   MapDelete.srv
  
)


Can someone help me get this to work? I have several other services that I call from the same js and python code that work. I don't know why this one is not working.

David Liebman

unread,
Mar 17, 2014, 11:29:35 AM3/17/14
to rosbrid...@googlegroups.com
it seems my code snippets are not that good. I can re-include things if people want.

David Liebman

unread,
Mar 17, 2014, 4:57:22 PM3/17/14
to rosbrid...@googlegroups.com
the javascript should look more like this:

ros = new ROSLIB.Ros({
        url : 'ws://localhost:9090'
      });
   
    map_service_load = new ROSLIB.Service({
        'ros' : ros,
        'name' : '/app_manager/application/' +
        '/load_map_db',
            serviceType : 'tele_presence/MapPublish'
      });
     
      var request = new ROSLIB.ServiceRequest({ "map_id": 'some-string'});
    map_service_load.callService( request, function (result) {
        //do something here
       
    } );

Chad Jenkins

unread,
Mar 18, 2014, 4:21:53 PM3/18/14
to rosbrid...@googlegroups.com

Hi David,

Thanks for using rosbridge and roslibjs.  Apologies for the delayed response.  It is a busy time these days.

If this is still an issue, could you post it to the roslibjs or rosbridge repos on Robot Web Tools?  I still check rosbridge-users, but most of the active developers tend to look at RWT repos.

  https://github.com/RobotWebTools/roslibjs

Thanks!
___
Chad


--
You received this message because you are subscribed to the Google Groups "Rosbridge Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rosbridge-use...@googlegroups.com.
To post to this group, send email to rosbrid...@googlegroups.com.
Visit this group at http://groups.google.com/group/rosbridge-users.
For more options, visit https://groups.google.com/d/optout.

Jihoon

unread,
Mar 18, 2014, 8:49:56 PM3/18/14
to rosbrid...@googlegroups.com
Hello David,

I was helping you in ROS Answers. I have created an issue regarding wait_for_service support in roslibjs issue tracker.
We can continue further discussion in the issue.

ROS Answers : http://answers.ros.org/question/140066/service-does-not-exist-app_manager-rapp-hydro-python-turtlebot/
Issue : https://github.com/RobotWebTools/roslibjs/issues/70

Regards,
Jihoon
Reply all
Reply to author
Forward
0 new messages