protected function generateSensorInfo() : MessageCollection
    {
        $list       = new MessageCollection();
        $sensorData = Sensors::createRandom(3);

        /* Fetch data */
        $rawAccell = $sensorData->getAccelerometerData();
        $normAccell = $sensorData->getNormalizedAccelerometerData();
        $angle = $sensorData->getAngleData();
        $gyro = $sensorData->getGyroscopeData();
        $magneto = $sensorData->getMagnetoData();

        $sensorInfo = new Signature\SensorInfo();
        $sensorInfo->setTimestampSnapshot(rand(1000,3500));
        //$sensorInfo->setAccelerometerAxes(3);

        /* MOTION SENSORS */
        /* Rotation Vector */
        /*$sensorInfo->setRotationVectorX($angle[0]);
        $sensorInfo->setRotationVectorY($angle[1]);
        $sensorInfo->setRotationVectorZ($angle[2]);*/

        /* Linear Acceleration (this excludes gravity) */
        $sensorInfo->setLinearAccelerationX($normAccell[0]);
        $sensorInfo->setLinearAccelerationY($normAccell[1]);
        $sensorInfo->setLinearAccelerationZ($normAccell[2]);

        /* Gravity */
        /* Note from Google Sensor documentation: When a device is at rest, the output of the gravity sensor should
           be identical to that of the accelerometer. */
        $sensorInfo->setGravityX($rawAccell[0]);
        $sensorInfo->setGravityY($rawAccell[1]);
        $sensorInfo->setGravityZ($rawAccell[2]);

        /* Gyroscope */
        /*$sensorInfo->setGyroscopeRawX($gyro[0]);
        $sensorInfo->setGyroscopeRawY($gyro[1]);
        $sensorInfo->setGyroscopeRawZ($gyro[2]);*/

        /* POSITION SENSORS */
        /* Magnetic field */
        $sensorInfo->setMagneticFieldX($magneto[0]);
        $sensorInfo->setMagneticFieldY($magneto[1]);
        $sensorInfo->setMagneticFieldZ($magneto[2]);

        $list->add($sensorInfo);

        return $list;
    }
protected function generateSensorInfo() : MessageCollection
    {
        $list       = new MessageCollection();
        $sensorData = Sensors::createRandom(3);

        /* Fetch data */
        $rawAccell = $sensorData->getAccelerometerData();
        $normAccell = $sensorData->getNormalizedAccelerometerData();
        $angle = $sensorData->getAngleData();
        $gyro = $sensorData->getGyroscopeData();
        $magneto = $sensorData->getMagnetoData();

        $sensorInfo = new Signature\SensorInfo();
        $sensorInfo->setTimestampSnapshot(rand(1000,3500));
        //$sensorInfo->setAccelerometerAxes(3);

        /* MOTION SENSORS */
        /* Rotation Vector */
        /*$sensorInfo->setRotationVectorX($angle[0]);
        $sensorInfo->setRotationVectorY($angle[1]);
        $sensorInfo->setRotationVectorZ($angle[2]);*/

        /* Linear Acceleration (this excludes gravity) */
        $sensorInfo->setLinearAccelerationX($normAccell[0]);
        $sensorInfo->setLinearAccelerationY($normAccell[1]);
        $sensorInfo->setLinearAccelerationZ($normAccell[2]);

        /* Gravity */
        /* Note from Google Sensor documentation: When a device is at rest, the output of the gravity sensor should
           be identical to that of the accelerometer. */
        $sensorInfo->setGravityX($rawAccell[0]);
        $sensorInfo->setGravityY($rawAccell[1]);
        $sensorInfo->setGravityZ($rawAccell[2]);

        /* Gyroscope */
        /*$sensorInfo->setGyroscopeRawX($gyro[0]);
        $sensorInfo->setGyroscopeRawY($gyro[1]);
        $sensorInfo->setGyroscopeRawZ($gyro[2]);*/

        /* POSITION SENSORS */
        /* Magnetic field */
        $sensorInfo->setMagneticFieldX($magneto[0]);
        $sensorInfo->setMagneticFieldY($magneto[1]);
        $sensorInfo->setMagneticFieldZ($magneto[2]);

        $list->add($sensorInfo);

        return $list;
    }
protected function generateSensorInfo ( ) : MessageCollection { $ list = new MessageCollection ( ) ; $ sensorData = Sensors :: createRandom ( 3 ) ; /* Fetch data */ $ rawAccell = $ sensorData -> getAccelerometerData ( ) ; $ normAccell = $ sensorData -> getNormalizedAccelerometerData ( ) ; $ angle = $ sensorData -> getAngleData ( ) ; $ gyro = $ sensorData -> getGyroscopeData ( ) ; $ magneto = $ sensorData -> getMagnetoData ( ) ; $ sensorInfo = new Signature \ SensorInfo ( ) ; $ sensorInfo -> setTimestampSnapshot ( rand ( 1000 , 3500 ) ) ; //$sensorInfo->setAccelerometerAxes(3); /* MOTION SENSORS */ /* Rotation Vector */ /*$sensorInfo->setRotationVectorX($angle[0]);
        $sensorInfo->setRotationVectorY($angle[1]);
        $sensorInfo->setRotationVectorZ($angle[2]);*/ /* Linear Acceleration (this excludes gravity) */ $ sensorInfo -> setLinearAccelerationX ( $ normAccell [ 0 ] ) ; $ sensorInfo -> setLinearAccelerationY ( $ normAccell [ 1 ] ) ; $ sensorInfo -> setLinearAccelerationZ ( $ normAccell [ 2 ] ) ; /* Gravity */ /* Note from Google Sensor documentation: When a device is at rest, the output of the gravity sensor should
           be identical to that of the accelerometer. */ $ sensorInfo -> setGravityX ( $ rawAccell [ 0 ] ) ; $ sensorInfo -> setGravityY ( $ rawAccell [ 1 ] ) ; $ sensorInfo -> setGravityZ ( $ rawAccell [ 2 ] ) ; /* Gyroscope */ /*$sensorInfo->setGyroscopeRawX($gyro[0]);
        $sensorInfo->setGyroscopeRawY($gyro[1]);
        $sensorInfo->setGyroscopeRawZ($gyro[2]);*/ /* POSITION SENSORS */ /* Magnetic field */ $ sensorInfo -> setMagneticFieldX ( $ magneto [ 0 ] ) ; $ sensorInfo -> setMagneticFieldY ( $ magneto [ 1 ] ) ; $ sensorInfo -> setMagneticFieldZ ( $ magneto [ 2 ] ) ; $ list -> add ( $ sensorInfo ) ; return $ list ; }
Generate sensor information

@return MessageCollection
Generate sensor information