예제 #1
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < CON_REQ_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._requestForConnection = struct.unpack('<?', bytes)[0]
예제 #2
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < CON_REQ_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._requestForConnection = struct.unpack('<?', bytes)[0]
예제 #3
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < BAT_STAT:
         bytes.append(data[self.index])
         self.index += 1
     self._status = struct.unpack('<f', bytes)[0]
예제 #4
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < LAT_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._lat = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < LNG_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._lng = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < METERS_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._meters = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < HDOP_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._HDOP = struct.unpack('<h', bytes)[0]
     bytes = bytearray()
     while self.index < SAT_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._satellites = struct.unpack('<h', bytes)[0]
     bytes = bytearray()
     while self.index < FIX_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._fix = struct.unpack('<b', bytes)[0]
예제 #5
0
    def buildRequest(self, data):
        RiCHeader.buildRequest(self, data)
        bytes = bytearray()

        while self.index < X:
            bytes.append(data[self.index])
            self.index += 1

        self._x = struct.unpack('<f', bytes)[0]

        bytes = bytearray()

        while self.index < Y:
            bytes.append(data[self.index])
            self.index += 1

        self._y = struct.unpack('<f', bytes)[0]

        bytes = bytearray()

        while self.index < Z:
            bytes.append(data[self.index])
            self.index += 1

        self._z = struct.unpack('<f', bytes)[0]
예제 #6
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < VER_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._ver = struct.unpack("<f", bytes)[0]
예제 #7
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < VER_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._ver = struct.unpack('<f', bytes)[0]
예제 #8
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < LAT_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._lat = struct.unpack('<d', bytes)[0]
     bytes = bytearray()
     while self.index < LNG_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._lng = struct.unpack('<d', bytes)[0]
     bytes = bytearray()
     while self.index < METERS_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._meters = struct.unpack('<d', bytes)[0]
     bytes = bytearray()
     while self.index < HDOP_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._HDOP = struct.unpack('<i', bytes)[0]
     bytes = bytearray()
     while self.index < SAT_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._satellites = struct.unpack('<i', bytes)[0]
     bytes = bytearray()
     while self.index < FIX_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._fix = struct.unpack('<q', bytes)[0]
예제 #9
0
    def buildRequest(self, data):
        RiCHeader.buildRequest(self, data)
        bytes = bytearray()

        while self.index < X:
            bytes.append(data[self.index])
            self.index += 1

        self._x = struct.unpack('<f', bytes)[0]

        bytes = bytearray()

        while self.index < Y:
            bytes.append(data[self.index])
            self.index += 1

        self._y = struct.unpack('<f', bytes)[0]

        bytes = bytearray()

        while self.index < Z:
            bytes.append(data[self.index])
            self.index += 1

        self._z = struct.unpack('<f', bytes)[0]
예제 #10
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < DEVICE_ID_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._IdToAck = struct.unpack('<b', bytes)[0]
     bytes = bytearray()
     while self.index < REQ_LENGTH_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._requestLength = struct.unpack('<b', bytes)[0]
예제 #11
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < ID_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._urfId = struct.unpack('<i', bytes)[0]
     bytes = bytearray()
     while self.index < RANGE_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._range = struct.unpack('<f', bytes)[0]
예제 #12
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < ID_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._urfId = struct.unpack('<B', bytes)[0]
     bytes = bytearray()
     while self.index < RANGE_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._range = struct.unpack('<f', bytes)[0]
예제 #13
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < SERVO_NUM_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._servoNum = struct.unpack('<B', bytes)[0]
     bytes = bytearray()
     while self.index < SERVO_POSITION_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._position = struct.unpack('<f', bytes)[0]
예제 #14
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < DEVICE_ID_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._IdToAck = struct.unpack('<i', bytes)[0]
     bytes = bytearray()
     while self.index < REQ_LENGTH_PLACE:
         bytes.append(data[self.index])
         self.index += 1
     self._requestLength = struct.unpack('<i', bytes)[0]
예제 #15
0
    def buildRequest(self, data):
        RiCHeader.buildRequest(self, data)
        bytes = bytearray()
        while self.index < ID_LEN:
            bytes.append(data[self.index])
            self.index += 1
        self._switchNum = struct.unpack('<i', bytes)[0]

        bytes = bytearray()
        while self.index < STATUS_LEN:
            bytes.append(data[self.index])
            self.index += 1
        self._status = struct.unpack('<i', bytes)[0]
예제 #16
0
    def buildRequest(self, data):
        RiCHeader.buildRequest(self, data)
        bytes = bytearray()
        while self.index < ID_LEN:
            bytes.append(data[self.index])
            self.index += 1
        self._switchNum = struct.unpack('<B', bytes)[0]

        bytes = bytearray()
        while self.index < STATUS_LEN:
            bytes.append(data[self.index])
            self.index += 1
        self._status = struct.unpack('<?', bytes)[0]
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < ODOM_X:
         bytes.append(data[self.index])
         self.index += 1
     self._odomX = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < ODOM_Y:
         bytes.append(data[self.index])
         self.index += 1
     self._odomY = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < ODOM_THATE:
         bytes.append(data[self.index])
         self.index += 1
     self._odomTheta = struct.unpack('<f', bytes)[0]
     # bytes = bytearray()
     # while self.index < TRAN_X:
     #     bytes.append(data[self.index])
     #     self.index += 1
     # self._translationX = struct.unpack('<f', bytes)[0]
     # bytes = bytearray()
     # while self.index < TRAN_Y:
     #     bytes.append(data[self.index])
     #     self.index += 1
     # self._translationY = struct.unpack('<f', bytes)[0]
     # bytes = bytearray()
     # while self.index < TRAN_Z:
     #     bytes.append(data[self.index])
     #     self.index += 1
     # self._translationZ = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < TRAN_ROT_Z:
         bytes.append(data[self.index])
         self.index += 1
     self._translationRotationZ = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < TRAN_ROT_W:
         bytes.append(data[self.index])
         self.index += 1
     self._translationRotationW = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < LINEAR_VEL:
         bytes.append(data[self.index])
         self.index += 1
     self._linearVelocity = struct.unpack('<f', bytes)[0]
예제 #18
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < MOTOR_ID:
         bytes.append(data[self.index])
         self.index += 1
     self._devId = struct.unpack('<B', bytes)[0]
     bytes = bytearray()
     while self.index < MOTOR_RAD:
         bytes.append(data[self.index])
         self.index += 1
     self._rad = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < MOTOR_RAD_S:
         bytes.append(data[self.index])
         self.index += 1
     self._rad_s = struct.unpack('<f', bytes)[0]
예제 #19
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < CHANNEL_1:
         bytes.append(data[self.index])
         self.index += 1
     self._ch1 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_2:
         bytes.append(data[self.index])
         self.index += 1
     self._ch2 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_3:
         bytes.append(data[self.index])
         self.index += 1
     self._ch3 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_4:
         bytes.append(data[self.index])
         self.index += 1
     self._ch4 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_5:
         bytes.append(data[self.index])
         self.index += 1
     self._ch5 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_6:
         bytes.append(data[self.index])
         self.index += 1
     self._ch6 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_7:
         bytes.append(data[self.index])
         self.index += 1
     self._ch7 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_8:
         bytes.append(data[self.index])
         self.index += 1
     self._ch8 = struct.unpack('<f', bytes)[0]
예제 #20
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < CHANNEL_1:
         bytes.append(data[self.index])
         self.index += 1
     self._ch1 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_2:
         bytes.append(data[self.index])
         self.index += 1
     self._ch2 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_3:
         bytes.append(data[self.index])
         self.index += 1
     self._ch3 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_4:
         bytes.append(data[self.index])
         self.index += 1
     self._ch4 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_5:
         bytes.append(data[self.index])
         self.index += 1
     self._ch5 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_6:
         bytes.append(data[self.index])
         self.index += 1
     self._ch6 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_7:
         bytes.append(data[self.index])
         self.index += 1
     self._ch7 = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < CHANNEL_8:
         bytes.append(data[self.index])
         self.index += 1
     self._ch8 = struct.unpack('<f', bytes)[0]
예제 #21
0
 def buildRequest(self, data):
     RiCHeader.buildRequest(self, data)
     bytes = bytearray()
     while self.index < V_X_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._velocityX = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < V_Y_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._velocityY = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < V_Z_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._velocityZ = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < A_X_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._accelerationX = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < A_Y_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._accelerationY = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < A_Z_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._accelerationZ = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < M_X_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._magnetometerX = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < M_Y_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._magnetometerY = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < M_Z_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._magnetometerZ = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < O_X_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._orientationX = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < O_Y_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._orientationY = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < O_Z_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._orientationZ = struct.unpack('<f', bytes)[0]
     bytes = bytearray()
     while self.index < O_W_LEN:
         bytes.append(data[self.index])
         self.index += 1
     self._orientationW = struct.unpack('<f', bytes)[0]