flexbe_core.proxy.proxy_service_caller module
A proxy for providing single service connection for FlexBE behaviors.
- class flexbe_core.proxy.proxy_service_caller.ProxyServiceCaller(topics=None, wait_duration=10)
Bases:
object
A proxy for calling services.
- classmethod call(topic, request, wait_duration=1.0)
Call service on the given topic.
@type topic: string @param topic: The topic to call.
@type request: service @param request: The request to send to this service.
@type wait_duration: float @param wait_duration: Seconds to wait for service to become available (default: 1.0)
- classmethod call_async(topic, request, wait_duration=1.0)
Perform an asynchronous service call on the given topic.
Completion and result can be checked via the “done” and “result” methods.
@type topic: string @param topic: The topic to call.
@type request: service @param request: The request to send to this service.
@type wait_duration: float @param wait_duration: Seconds to wait for service to become available (default: 1.0)
- classmethod destroy_service(srv, topic)
Handle service client destruction from within the executor threads.
- classmethod done(topic)
Check whether a service call on the given topic has already completed.
@type topic: string @param topic: The topic to call.
- static initialize(node)
Initialize ROS setup for proxy service caller.
- classmethod is_available(topic, wait_duration=1.0)
Check if the service on the given topic is available.
@type topic: string @param topic: The topic of interest. @type wait_duration: float @param wait_duration: Seconds to wait for service to become available (default: 1.0)
- classmethod result(topic)
Obtain the result of a completed service call on the given topic.
@type topic: string @param topic: The topic to call.
- classmethod setupService(topic, srv_type, wait_duration=10)
Set up a service caller for calling it later.
@type topic: string @param topic: The topic of the service to call.
@type srv_type: service class @param srv_type: The type of messages of this service.
@type wait_duration: float @param wait_duration: Defines how long to wait for the given service if it is not available right now.
- static shutdown()
Shut down this proxy by reseting all service callers.