ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SOLVED!

Well the Problem in generl was .... the parameter was placed in there... well and i just did smth. quick and dirty ^^

    def handle_dynamic_map(self,resp):
    return GetMapResponse(param)

def dynamic_map_server(self):
    s = rospy.Service('dynamic_map', GetMap, self.handle_dynamic_map)

Yeah i know that "resp" thing at handle_dynamic_map might seem to be useless ... it only works like that

The Main was not changed...

now the Service-Client:

#!/usr/bin/env python

import sys
import rospy
from nav_msgs.srv import GetMap

def dynamic_map_client():
    rospy.wait_for_service('dynamic_map')
    try:
        Imported = rospy.ServiceProxy('dynamic_map', GetMap)

    resp1 = Imported()
    return resp1.map
except rospy.ServiceException, e:
    print "Service call failed: %s"%e

if __name__ == "__main__":
    print dynamic_map_client()

Yeah it works like that :)