new Service(options)
A ROS service client.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
Methods
advertise(callback)
Advertise the service. This turns the Service object from a client into a server. The callback will be called with every request that's made on this service.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
callback |
function | This works similarly to the callback for a C++ service and should take the following params: Properties
|
- Source:
callService(request, callback, failedCallbackopt)
Call the service. Returns the service response in the callback. Does nothing if this service is currently advertised.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
ServiceRequest | The ROSLIB.ServiceRequest to send. |
|||||||
callback |
function | Function with the following params: Properties
|
|||||||
failedCallback |
function |
<optional> |
The callback function when the service call failed with params: Properties
|
- Source: