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.