资源简介
基于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经典题目的程序
- 单载波频域均衡技术的Matlab仿真研究
- matlab的GAOT的工具箱
- VMD算法matlab函数.zip
- 基于matlab的圆形线圈互感计算
- 电力系统14节点模型
- 直流电机双闭环matlab仿真
- 直流电机开环和比例控制闭环simuli<
-
MATLAB机械臂简单控制仿真Simuli
nk篇 - 降雨雷达的时空匹配matlab代码
-
simuli
nk的S函数实现多智能体一致性 - 电力电子各种电路Matlab仿真
- DTW动态时间规整matlab代码
- 用于生成ask2fsk4fskbpskqpskDLFM时频图数据
- 蚁群算法路径规划避障MATLAB源程序
- 计算一维信号计盒维数matlab程序
- 人工神经网络预测matlab
- 最小二乘法曲线拟合matlab代码
- MATLAB大作业
- 飞行轨迹仿真
- 三参数威布尔分布线性相关法拟合程
- Matlab读取TDMS文件并存储为mat格式
- FW交通均衡求解算法
- matlab打开电脑摄像头动态追踪人脸位
- 捷联惯导matlab程序
- 学生成绩查询系统
- 基于MATLAB的VANET仿真.zip
- PPL锁相环matlab
- 计算SINR的matlab程序,带入参数可以直
- 基于matlab的小车避障仿真
评论
共有 条评论