资源简介
基于Life Performance公司的姿态传感器所编写的Matlab实例。
可以实时读取传感器数据并进行姿态解算。
代码片段和文件信息
classdef lpms < handle
% Lpms class to interface with LpmsSensors
%
% Known Issues:
% - Serial Interrupt routine blocks main processing thread
% when transferring at data rate > 100Hz
%
% TODO:
% - Implement 16bit data parsing
properties (Constant)
PACKET_ADDRESS0 = 0;
PACKET_ADDRESS1 = 1;
PACKET_FUNCTION0 = 2;
PACKET_FUNCTION1 = 3;
PACKET_LENGTH0 = 4;
PACKET_LENGTH1 = 5;
PACKET_RAW_DATA = 6;
PACKET_LRC_CHECK0 = 7;
PACKET_LRC_CHECK1 = 8;
PACKET_END = 9;
MAX_BUFFER = 4096;
% Command register
REPLY_ACK = 0;
REPLY_NACK = 1;
GET_CONFIG = 4;
GET_STATUS = 5;
GOTO_COMMAND_MODE = 6;
GOTO_STREAM_MODE = 7;
GET_SENSOR_DATA = 9;
GET_SERIAL_NUMBER = 90;
GET_DEVICE_NAME = 91;
GET_FIRMWARE_INFO = 92;
%Configuration register contents
LPMS_GYR_AUTOCAL_ENABLED = bitshift(1 30);
LPMS_LPBUS_DATA_MODE_16BIT_ENABLED = bitshift(1 22);
LPMS_LINACC_OUTPUT_ENABLED = bitshift(1 21);
LPMS_DYNAMIC_COVAR_ENABLED = bitshift(1 20);
LPMS_ALTITUDE_OUTPUT_ENABLED = bitshift(1 19);
LPMS_QUAT_OUTPUT_ENABLED = bitshift(1 18);
LPMS_EULER_OUTPUT_ENABLED = bitshift(1 17);
LPMS_ANGULAR_VELOCITY_OUTPUT_ENABLED = bitshift(1 16);
LPMS_GYR_CALIBRA_ENABLED = bitshift(1 15);
LPMS_HEAVEMOTION_OUTPUT_ENABLED = bitshift(1 14);
LPMS_TEMPERATURE_OUTPUT_ENABLED = bitshift(1 13);
LPMS_GYR_RAW_OUTPUT_ENABLED = bitshift(1 12);
LPMS_ACC_RAW_OUTPUT_ENABLED = bitshift(1 11);
LPMS_MAG_RAW_OUTPUT_ENABLED = bitshift(1 10);
LPMS_PRESSURE_OUTPUT_ENABLED = bitshift(1 9);
LPMS_STREAM_FREQ_5HZ_ENABLED = 0;
LPMS_STREAM_FREQ_10HZ_ENABLED = 1;
LPMS_STREAM_FREQ_25HZ_ENABLED = 2;
LPMS_STREAM_FREQ_50HZ_ENABLED = 3;
LPMS_STREAM_FREQ_100HZ_ENABLED = 4;
LPMS_STREAM_FREQ_200HZ_ENABLED = 5;
LPMS_STREAM_FREQ_400HZ_ENABLED = 6;
LPMS_STREAM_FREQ_MASK = 7;
LPMS_STREAM_FREQ_5HZ = 5;
LPMS_STREAM_FREQ_10HZ = 10;
LPMS_STREAM_FREQ_25HZ = 25;
LPMS_STREAM_FREQ_50HZ = 50;
LPMS_STREAM_FREQ_100HZ = 100;
LPMS_STREAM_FREQ_200HZ = 200;
LPMS_STREAM_FREQ_400HZ = 400;
PARAMETER_SET_DELAY = 0.01;
DATA_QUEUE_SIZE = 64;
end
properties
% serial
serConn;
isSensorConnected = false;
% define the properties of the class here (like fields of a struct)
rxBuffer = uint8(zeros(1 lpms.MAX_BUFFER));
rawTxBuffer = uint8(zer属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 25477 2018-07-20 16:23 LPMS MatLab实例\lpms.m
文件 904 2018-07-20 16:23 LPMS MatLab实例\LpmsDataRecordingDemo.m
文件 1099 2018-07-20 16:23 LPMS MatLab实例\LpmsRealTimePlotDemo.m
相关资源
- 四旋翼MATLAB仿真文件+实验报告
- 串行级联cpm系统MATLAB仿真
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
川公网安备 51152502000135号
评论
共有 条评论