(self, pub_msg, timeout=5.0, poll_delay=0.01,
                         check_id=False)
return self._subscriber_msg
Publish a message and wait for the response.
        Args:
            pub_msg: Message to publish.
            timeout: Timeout in seconds.
            poll_delay: Speed of polling for the subscriber message in
                seconds.
            check_id: If enabled, will only return messages with a
                matching id field.
        Returns:
            sub_msg: Subscriber message.
Publish a message and wait for the response.
        Args:
            pub_msg: Message to publish.
            timeout: Timeout in seconds.
            poll_delay: Speed of polling for the subscriber message in
                seconds.
            check_id: If enabled, will only return messages with a
                matching id field.
        Returns:
            sub_msg: Subscriber message.
Publish a message and wait for the response . Args : pub_msg : Message to publish . timeout : Timeout in seconds . poll_delay : Speed of polling for the subscriber message in seconds . check_id : If enabled will only return messages with a matching id field . Returns : sub_msg : Subscriber message .
def publish_and_wait(self, pub_msg, timeout=5.0, poll_delay=0.01,
                         check_id=False):
        """
        Publish a message and wait for the response.
        Args:
            pub_msg: Message to publish.
            timeout: Timeout in seconds.
            poll_delay: Speed of polling for the subscriber message in
                seconds.
            check_id: If enabled, will only return messages with a
                matching id field.
        Returns:
            sub_msg: Subscriber message.
        """
        if check_id:  # This is not yet implemented in C++.
            raise NotImplementedError()

        self._waiting = True
        self.publish(pub_msg)

        time_waited = 0
        while self._waiting:
            rospy.sleep(poll_delay)
            time_waited += 0.01
            if time_waited > timeout:
                raise TimeoutException(time_waited)
        return self._subscriber_msg
def publish_and_wait ( self , pub_msg , timeout = 5.0 , poll_delay = 0.01 , check_id = False ) : if check_id : # This is not yet implemented in C++. raise NotImplementedError ( ) self . _waiting = True self . publish ( pub_msg ) time_waited = 0 while self . _waiting : rospy . sleep ( poll_delay ) time_waited += 0.01 if time_waited > timeout : raise TimeoutException ( time_waited ) return self . _subscriber_msg