Beispiel #1
0
    def do_gazebo_request(self,
                          request,
                          data=None,
                          dbl_data=None,
                          msg_id=None):
        """
        Convenience wrapper to use `do_request` with a default Gazebo
        `Request` message. See that method for more info.

        :param request:
        :type request: str
        :param data:
        :param dbl_data:
        :param msg_id: Force the message to use this ID. Sequencer is used if no message
                       ID is specified.
        :type msg_id: int
        :return:
        """
        if msg_id is None:
            msg_id = self.get_msg_id()

        req = request_pb2.Request()
        req.id = msg_id
        req.request = request

        if data is not None:
            req.data = data

        if dbl_data is not None:
            req.dbl_data = dbl_data

        future = yield From(self.do_request(req))
        raise Return(future)
Beispiel #2
0
    def _do_gazebo_request(self, request, data=None, dbl_data=None):
        """
        Convenience wrapper to use `do_request` with a default Gazebo
        `Request` message. See that method for more info.

        :param request:
        :type request: str
        :param data:
        :param dbl_data:
        :param msg_id: Force the message to use this ID. Sequencer is used if no message
                       ID is specified.
        :type msg_id: int
        :return:
        """
        req = request_pb2.Request()
        req.id = self.get_unique_id()
        req.request = request

        if data is not None:
            req.data = data

        if dbl_data is not None:
            req.dbl_data = dbl_data

        return self.request_handler.do_request(req)