主要内容

Sensor Data Collection with马铃薯草移动的或者马铃薯草在线的

概述

您可以将传感器数据传送到您的马铃薯草®移动™或者马铃薯草在线的™使用您的设备会话。马铃薯草移动的sends the data in real-time with a WiFi or cellular connection to MATLAB running in the MathWorks®云。您可以从传感器数据执行MATLAB操作马铃薯草移动的或者马铃薯草在线的

马铃薯草移动的马铃薯草在线的提供MATLAB命令行界面,具有与设备传感器交互的功能。要在设备上连接到传感器并收集数据,您可以创建一个Mobiledev.object in MATLAB.

You can also acquire sensor data locally on the iOS device, with or without a network connection. This is an alternative method of collecting the sensor data instead of streaming it from the device to the Cloud. This is especially useful if you want to collect sensor data while your device does not have a network connection. For examples of using this method of acquisition, see在本地日志传感器数据

You can also access the camera and acquire images on your iOS mobile device from马铃薯草移动的马铃薯草在线的。You can set camera properties including resolution, autofocus, and flash. For an example, see从iOS相机获取图像。Then, process the acquired images. For an example, seeClassify Images from iOS Camera Using Pretrained Network

Use MATLAB to process sensor data in various ways, including creating plots. For an example of acquiring data and plotting it, see使用记录的传感器数据示例

Requirements for Using Sensors

使用iOS传感器马铃薯草移动的或者马铃薯草在线的, make sure you have the following:

  • 安装马铃薯草移动的在您的iOS设备上。您可以通过此应用程序获取此申请应用商店

  • To stream or upload sensor data to the MathWorks Cloud, you must have a MathWorks Account. If you do not have an account, you can set one up in马铃薯草移动的或者马铃薯草在线的

马铃薯草移动的Sensors Screen

To open theSensorsscreen in马铃薯草移动的, 轻敲Sensorson the menu.

在传感器显示的顶部是传感器设置。看Sensor Settings

Below the settings are the sensor displays. They are arranged in the following order, and show these measurements:

  • 加速- 加速读取X,Y, 和Zcoordinates, in m/s2(每秒平方米)

  • 磁场- 磁场阅读X,Y, 和Zcoordinates, in microtesla

  • Orientation— Position reading inX,Y, 和Z坐标,以方位,俯仰和滚动

  • 角速度- 角速度读取X,Y, 和Zrotations, in radians per second

  • 位置- 代表纬度,经度,速度,课程,高度和水平精度的数据点。位置数据是从GPS,Wi-Fi获得的®或者使用可用的蜂窝网络。测量是:

    • Latitude in degrees relative to the equator, with positive values indicating latitudes north of the equator

    • 相对于零个子的经度程度,具有阳性值在子午线以东延伸

    • Speed in m/s (meters per second)

    • 在度相对于真北

    • Altitude in meters above sea level

    • Horizontal Accuracy in meters defined by a circle around the latitude and longitude

Turn individual sensors on and off using the toggle switch.

加速切换交换机

When you turn on a sensor, the measurement readings begin and are displayed in each sensor's section. In this example, Acceleration and Magnetic Field have been turned on.

Image showing acceleration and magnetic field enabled

After you have turned on one or more sensors, use theStartbutton to log data. To send the data to MATLAB on the MathWorks Cloud instead, go to the sensor settings and change theStream to环境。看具有传感器控制的传感器数据

You can also start the transmission of data from MATLAB programmatically using the日志ging财产的财产Mobiledev.object. See使用MobileDev.logging属性流传输传感器数据。You must enable MATLAB programmatic access first in sensor settings.

Sensor Settings

Use the Sensors settings to manage sensor data collection on your device. The sensor settings appear before the sensor displays.

Image of sensor settings display

选项是:

  • Stream to- 选择任一个马铃薯草(在Cloud) or日志

  • Sensor Logs

    • View logs on MATLAB Drive- 显示上传到您的传感器日志列表Matlab Drive™

    • 配置

      • Sensors- 控制MATLAB访问传感器。默认情况下,访问仍然是持续的,以便控制来自MATLAB的传感器和数据流。

      • Camera— Controls MATLAB access to the cameras. The access is on by default and needs to remain on in order to control camera input from MATLAB.

      • Send Position Data in Background— This setting is off by default, but you can turn it on to continue to send Position data when the application goes into the background on the device.

      • 上传Folder- 上传日志文件的目标文件夹。默认文件夹是马铃薯草Drive/MobileSensorData。You can change the upload folder in this setting.

      • 自动上传- 此设置确定数据日志文件的上传方式马铃薯草Drive

        • 启用 - 如果自动上传is on, and you have a network connection on your device, log files are automatically uploaded to马铃薯草Drive。If自动上传is on and you do not currently have a network connection, the files will automatically upload the next time the device detects a network connection (WiFi or cellular, if selected).

        • 残疾人 - 如果自动上传关闭,您必须手动将文件上传到您的文件马铃薯草Drive。看步骤2.传输传感器日志

        Note

        如果您使用的是Wi-Fi作为连接方法,则设备上的Wi-Fi可能会享受应调整的睡眠设置。

    • 在您的设备上注销- 显示设备上的传感器日志列表。已经成功上传到您的日志马铃薯草Drive显示成功的云图标云图标。When there is a failure uploading a log file, this display shows a failure Cloud icon.

  • Sample rate— Enter the sample rate to apply to the following sensors: acceleration, magnetic field, orientation, and angular velocity.

  • 轻敲更多的to access:

    • Sensors- 控制MATLAB访问传感器。默认情况下,访问仍然是持续的,以便控制来自MATLAB的传感器和数据流。

    • Camera— Controls MATLAB access to the cameras. The access is on by default and needs to remain on in order to control camera input from MATLAB.

    • Send Position Data in Background— This setting is off by default, but you can turn it on to continue to send Position data when the application goes into the background on the device.

    • 上传Folder- 上传日志文件的目标文件夹。默认文件夹是马铃薯草Drive/MobileSensorData。You can change the upload folder in this setting.

    • 自动上传- 此设置确定数据日志文件的上传方式马铃薯草Drive

      • 启用 - 如果自动上传is on, and you have a network connection on your device, log files are automatically uploaded to马铃薯草Drive。If自动上传is on and you do not currently have a network connection, the files will automatically upload the next time the device detects a network connection (WiFi or cellular, if selected).

      • 残疾人 - 如果自动上传关闭,您必须手动将文件上传到您的文件马铃薯草Drive。轻敲Sensor Logs。Under在您的设备上注销,向左滑动您要上传的文件,然后点击上传

      Note

      如果您使用的是Wi-Fi作为连接方法,则设备上的Wi-Fi可能会享受应调整的睡眠设置。

设备方向

加速,角速度,磁场和方向传感器与之相关的所有日志数据X,YZaxes. This diagram shows these axes relative to the device.

相对于设备的加速度,角速度,磁场和方向传感器轴的图像

请注意,当设备平整在表面上时,Z轴是正值。这是通过设计,与Matlab公约一致。当器件在表面上平坦时,沿Z轴的加速度值是+9.81,这对应于设备的加速度(0 m / s ^ 2)减去重力的加速度(-9.81 m / s ^ 2)。

相关话题