; Auto-generated. Do not edit!


(in-package test_ros-msg)


;//! \htmlinclude TestArrays.msg.html

(defclass <TestArrays> (ros-message)
  ((caller_id
    :reader caller_id-val
    :initarg :caller_id
    :type string
    :initform "")
   (orig_caller_id
    :reader orig_caller_id-val
    :initarg :orig_caller_id
    :type string
    :initform "")
   (int32_array
    :reader int32_array-val
    :initarg :int32_array
    :type (vector integer)
   :initform (make-array 0 :element-type 'integer :initial-element 0))
   (float32_array
    :reader float32_array-val
    :initarg :float32_array
    :type (vector float)
   :initform (make-array 0 :element-type 'float :initial-element 0.0))
   (time_array
    :reader time_array-val
    :initarg :time_array
    :type (vector real)
   :initform (make-array 0 :element-type 'real :initial-element 0))
   (test_string_array
    :reader test_string_array-val
    :initarg :test_string_array
    :type (vector <TestString>)
   :initform (make-array 0 :element-type '<TestString> :initial-element (make-instance '<TestString>))))
)
(defmethod serialize ((msg <TestArrays>) ostream)
  "Serializes a message object of type '<TestArrays>"
  (let ((__ros_str_len (length (slot-value msg 'caller_id))))
    (write-byte (ldb (byte 8 0) __ros_str_len) ostream)
    (write-byte (ldb (byte 8 8) __ros_str_len) ostream)
    (write-byte (ldb (byte 8 16) __ros_str_len) ostream)
    (write-byte (ldb (byte 8 24) __ros_str_len) ostream))
  (map nil #'(lambda (c) (write-byte (char-code c) ostream)) (slot-value msg 'caller_id))
  (let ((__ros_str_len (length (slot-value msg 'orig_caller_id))))
    (write-byte (ldb (byte 8 0) __ros_str_len) ostream)
    (write-byte (ldb (byte 8 8) __ros_str_len) ostream)
    (write-byte (ldb (byte 8 16) __ros_str_len) ostream)
    (write-byte (ldb (byte 8 24) __ros_str_len) ostream))
  (map nil #'(lambda (c) (write-byte (char-code c) ostream)) (slot-value msg 'orig_caller_id))
  (let ((__ros_arr_len (length (slot-value msg 'int32_array))))
    (write-byte (ldb (byte 8 0) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 8) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 16) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 24) __ros_arr_len) ostream))
  (map nil #'(lambda (ele)   (write-byte (ldb (byte 8 0) ele) ostream)
  (write-byte (ldb (byte 8 8) ele) ostream)
  (write-byte (ldb (byte 8 16) ele) ostream)
  (write-byte (ldb (byte 8 24) ele) ostream))
    (slot-value msg 'int32_array))
  (let ((__ros_arr_len (length (slot-value msg 'float32_array))))
    (write-byte (ldb (byte 8 0) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 8) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 16) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 24) __ros_arr_len) ostream))
  (map nil #'(lambda (ele) (let ((bits (roslisp-utils:encode-single-float-bits ele)))
    (write-byte (ldb (byte 8 0) bits) ostream)
    (write-byte (ldb (byte 8 8) bits) ostream)
    (write-byte (ldb (byte 8 16) bits) ostream)
    (write-byte (ldb (byte 8 24) bits) ostream)))
    (slot-value msg 'float32_array))
  (let ((__ros_arr_len (length (slot-value msg 'time_array))))
    (write-byte (ldb (byte 8 0) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 8) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 16) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 24) __ros_arr_len) ostream))
  (map nil #'(lambda (ele) (let ((__sec (floor ele))
        (__nsec (round (* 1e9 (- ele (floor ele))))))
    (write-byte (ldb (byte 8 0) __sec) ostream)
    (write-byte (ldb (byte 8 8) __sec) ostream)
    (write-byte (ldb (byte 8 16) __sec) ostream)
    (write-byte (ldb (byte 8 24) __sec) ostream)
    (write-byte (ldb (byte 8 0) __nsec) ostream)
    (write-byte (ldb (byte 8 8) __nsec) ostream)
    (write-byte (ldb (byte 8 16) __nsec) ostream)
    (write-byte (ldb (byte 8 24) __nsec) ostream)))
    (slot-value msg 'time_array))
  (let ((__ros_arr_len (length (slot-value msg 'test_string_array))))
    (write-byte (ldb (byte 8 0) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 8) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 16) __ros_arr_len) ostream)
    (write-byte (ldb (byte 8 24) __ros_arr_len) ostream))
  (map nil #'(lambda (ele) (serialize ele ostream))
    (slot-value msg 'test_string_array))
)
(defmethod deserialize ((msg <TestArrays>) istream)
  "Deserializes a message object of type '<TestArrays>"
  (let ((__ros_str_len 0))
    (setf (ldb (byte 8 0) __ros_str_len) (read-byte istream))
    (setf (ldb (byte 8 8) __ros_str_len) (read-byte istream))
    (setf (ldb (byte 8 16) __ros_str_len) (read-byte istream))
    (setf (ldb (byte 8 24) __ros_str_len) (read-byte istream))
    (setf (slot-value msg 'caller_id) (make-string __ros_str_len))
    (dotimes (__ros_str_idx __ros_str_len msg)
      (setf (char (slot-value msg 'caller_id) __ros_str_idx) (code-char (read-byte istream)))))
  (let ((__ros_str_len 0))
    (setf (ldb (byte 8 0) __ros_str_len) (read-byte istream))
    (setf (ldb (byte 8 8) __ros_str_len) (read-byte istream))
    (setf (ldb (byte 8 16) __ros_str_len) (read-byte istream))
    (setf (ldb (byte 8 24) __ros_str_len) (read-byte istream))
    (setf (slot-value msg 'orig_caller_id) (make-string __ros_str_len))
    (dotimes (__ros_str_idx __ros_str_len msg)
      (setf (char (slot-value msg 'orig_caller_id) __ros_str_idx) (code-char (read-byte istream)))))
  (let ((__ros_arr_len 0))
    (setf (ldb (byte 8 0) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 8) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 16) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 24) __ros_arr_len) (read-byte istream))
    (setf (slot-value msg 'int32_array) (make-array __ros_arr_len))
    (let ((vals (slot-value msg 'int32_array)))
      (dotimes (i __ros_arr_len)
(setf (ldb (byte 8 0) (aref vals i)) (read-byte istream))
  (setf (ldb (byte 8 8) (aref vals i)) (read-byte istream))
  (setf (ldb (byte 8 16) (aref vals i)) (read-byte istream))
  (setf (ldb (byte 8 24) (aref vals i)) (read-byte istream)))))
  (let ((__ros_arr_len 0))
    (setf (ldb (byte 8 0) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 8) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 16) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 24) __ros_arr_len) (read-byte istream))
    (setf (slot-value msg 'float32_array) (make-array __ros_arr_len))
    (let ((vals (slot-value msg 'float32_array)))
      (dotimes (i __ros_arr_len)
(let ((bits 0))
    (setf (ldb (byte 8 0) bits) (read-byte istream))
    (setf (ldb (byte 8 8) bits) (read-byte istream))
    (setf (ldb (byte 8 16) bits) (read-byte istream))
    (setf (ldb (byte 8 24) bits) (read-byte istream))
    (setf (aref vals i) (roslisp-utils:decode-single-float-bits bits))))))
  (let ((__ros_arr_len 0))
    (setf (ldb (byte 8 0) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 8) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 16) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 24) __ros_arr_len) (read-byte istream))
    (setf (slot-value msg 'time_array) (make-array __ros_arr_len))
    (let ((vals (slot-value msg 'time_array)))
      (dotimes (i __ros_arr_len)
(let ((__sec 0) (__nsec 0))
    (setf (ldb (byte 8 0) __sec) (read-byte istream))
    (setf (ldb (byte 8 8) __sec) (read-byte istream))
    (setf (ldb (byte 8 16) __sec) (read-byte istream))
    (setf (ldb (byte 8 24) __sec) (read-byte istream))
    (setf (ldb (byte 8 0) __nsec) (read-byte istream))
    (setf (ldb (byte 8 8) __nsec) (read-byte istream))
    (setf (ldb (byte 8 16) __nsec) (read-byte istream))
    (setf (ldb (byte 8 24) __nsec) (read-byte istream))
    (setf (aref vals i) (+ (coerce __sec 'double-float) (/ __nsec 1e9)))))))
  (let ((__ros_arr_len 0))
    (setf (ldb (byte 8 0) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 8) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 16) __ros_arr_len) (read-byte istream))
    (setf (ldb (byte 8 24) __ros_arr_len) (read-byte istream))
    (setf (slot-value msg 'test_string_array) (make-array __ros_arr_len))
    (let ((vals (slot-value msg 'test_string_array)))
      (dotimes (i __ros_arr_len)
        (setf (aref vals i) (make-instance '<TestString>))
(deserialize (aref vals i) istream))))
  msg
)
(defmethod ros-datatype ((msg (eql '<TestArrays>)))
  "Returns string type for a message object of type '<TestArrays>"
  "test_ros/TestArrays")
(defmethod md5sum ((type (eql '<TestArrays>)))
  "Returns md5sum for a message object of type '<TestArrays>"
  "4cc9b5e2cebe791aa3e994f5bc159eb6")
(defmethod message-definition ((type (eql '<TestArrays>)))
  "Returns full string definition for message of type '<TestArrays>"
  (format nil "# caller_id of most recent node to send this message~%string caller_id~%# caller_id of the original node to send this message~%string orig_caller_id~%~%int32[] int32_array~%float32[] float32_array~%time[] time_array~%TestString[] test_string_array~%# TODO: array of arrays~%~%================================================================================~%MSG: test_ros/TestString~%# Integration test message~%# caller_id of most recent node to send this message~%string caller_id~%# caller_id of the original node to send this message~%string orig_caller_id~%string data~%~%~%"))
(defmethod serialization-length ((msg <TestArrays>))
  (+ 0
     4 (length (slot-value msg 'caller_id))
     4 (length (slot-value msg 'orig_caller_id))
     4 (reduce #'+ (slot-value msg 'int32_array) :key #'(lambda (ele) (declare (ignorable ele)) (+ 4)))
     4 (reduce #'+ (slot-value msg 'float32_array) :key #'(lambda (ele) (declare (ignorable ele)) (+ 4)))
     4 (reduce #'+ (slot-value msg 'time_array) :key #'(lambda (ele) (declare (ignorable ele)) (+ 8)))
     4 (reduce #'+ (slot-value msg 'test_string_array) :key #'(lambda (ele) (declare (ignorable ele)) (+ (serialization-length ele))))
))
(defmethod ros-message-to-list ((msg <TestArrays>))
  "Converts a ROS message object to a list"
  (list '<TestArrays>
    (cons ':caller_id (caller_id-val msg))
    (cons ':orig_caller_id (orig_caller_id-val msg))
    (cons ':int32_array (int32_array-val msg))
    (cons ':float32_array (float32_array-val msg))
    (cons ':time_array (time_array-val msg))
    (cons ':test_string_array (test_string_array-val msg))
))
