def _do_add_text_messages(self, func, text_messages, **kwargs):
        request = log_annotation_protos.AddLogAnnotationRequest()
        for in_text_msg in text_messages:
            request.annotations.text_messages.add().CopyFrom(in_text_msg)

        return func(self._stub.AddLogAnnotation, request, value_from_response=None,
                    error_from_response=common_header_errors, **kwargs)
Exemple #2
0
    def add_log_blob(self,
                     data,
                     type_id,
                     channel=None,
                     robot_timestamp=None,
                     **kw_args):
        """Log blob messages to the robot.

        Args:
          data:                 Binary data of one blob.
          type_id:              Type of binary data of blob.
          robot_timestamp:      Time (google.protobuf.Timestamp) of messages, in *robot time*.
                                If not set, timestamp will be when the robot receives the message.
          kw_args:        Extra arguments to pass to grpc call invocation.
        """
        request = log_annotation_protos.AddLogAnnotationRequest()

        if not channel:
            channel = type_id

        request.annotations.blob_data.add(timestamp=robot_timestamp,
                                          channel=channel,
                                          type_id=type_id,
                                          data=data)

        return self.call(self._stub.AddLogAnnotation,
                         request,
                         value_from_response=None,
                         error_from_response=common_header_errors,
                         **kw_args)
    def _do_add_log_blob(self, func, data, type_id, channel, robot_timestamp, **kwargs):
        request = log_annotation_protos.AddLogAnnotationRequest()

        if not channel:
            channel = type_id

        robot_timestamp = robot_timestamp or self._now_in_robot_basis(msg_type=type_id)
        request.annotations.blob_data.add(timestamp=robot_timestamp, channel=channel,
                                          type_id=type_id, data=data)

        return func(self._stub.AddLogAnnotation, request, value_from_response=None,
                    error_from_response=common_header_errors, **kwargs)
Exemple #4
0
 def _do_add_operator_comment(self,
                              func,
                              msg,
                              robot_timestamp=None,
                              **kwargs):
     request = log_annotation_protos.AddLogAnnotationRequest()
     robot_timestamp = robot_timestamp or self._now_in_robot_basis(
         msg_type="Operator Comment")
     request.annotations.operator_messages.add(message=msg,
                                               timestamp=robot_timestamp)
     return func(self._stub.AddLogAnnotation,
                 request,
                 value_from_response=None,
                 error_from_response=common_header_errors,
                 **kwargs)
Exemple #5
0
    def add_operator_comment(self, msg, robot_timestamp=None, **kw_args):
        """Add an operator comment to the robot log

        Args:
          msg:                  Text of user comment to log.
          robot_timestamp:      Time (google.protobuf.Timestamp) of messages, in *robot time*.
                                If not set, timestamp will be when the robot receives the message.
          kw_args:              Extra arguments to pass to grpc call invocation.
        """
        request = log_annotation_protos.AddLogAnnotationRequest()
        request.annotations.operator_messages.add(message=msg,
                                                  timestamp=robot_timestamp)
        return self.call(self._stub.AddLogAnnotation,
                         request,
                         value_from_response=None,
                         error_from_response=common_header_errors,
                         **kw_args)
Exemple #6
0
    def add_text_messages(self, text_messages, **kw_args):
        """Log text messages to the robot.

        Args:
          text_messages:  Sequence of LogAnnotationTextMessage protos.
          kw_args:        Extra arguments to pass to grpc call invocation.
        """

        request = log_annotation_protos.AddLogAnnotationRequest()
        for in_text_msg in text_messages:
            request.annotations.text_messages.add().CopyFrom(in_text_msg)

        return self.call(self._stub.AddLogAnnotation,
                         request,
                         value_from_response=None,
                         error_from_response=common_header_errors,
                         **kw_args)