2022-05-29 23:24:27 +08:00
|
|
|
|
#ifndef WITMOTIONDLL_H
|
|
|
|
|
#define WITMOTIONDLL_H
|
|
|
|
|
|
|
|
|
|
#include "witmotiondll_global.h"
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <string.h>
|
2022-05-31 22:44:39 +08:00
|
|
|
|
#include <thread>
|
2022-05-29 23:24:27 +08:00
|
|
|
|
|
|
|
|
|
#include "serialportbase.h"
|
2022-05-31 22:44:39 +08:00
|
|
|
|
#include "register.h"
|
2022-05-29 23:24:27 +08:00
|
|
|
|
|
|
|
|
|
class WITMOTIONDLLSHARED_EXPORT WitmotionDll
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
WitmotionDll(SerialPortBase * serialPort);
|
|
|
|
|
|
2022-05-31 22:44:39 +08:00
|
|
|
|
int unlockInstruction();
|
|
|
|
|
int saveInstruction();
|
2022-05-29 23:24:27 +08:00
|
|
|
|
|
2022-05-31 22:44:39 +08:00
|
|
|
|
void recordData();
|
|
|
|
|
|
|
|
|
|
//系统
|
|
|
|
|
int algorithm(ALGROITHM_ENUM algorithm);
|
|
|
|
|
int installationOrientation(ORIENT_ENUM orient);
|
|
|
|
|
int instructStart(POWONSEND_ENUM command);//是否上电输出数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//校准:完成后,需要退出校准模式( 调用exitCalibration)
|
|
|
|
|
int exitCalibration();//退出校准模式
|
2022-05-29 23:24:27 +08:00
|
|
|
|
|
|
|
|
|
int magneticCalibration();
|
2022-05-31 22:44:39 +08:00
|
|
|
|
int setHeightToZero();//需要JY901B带有高度数据输出的模块才能进行高度校准,此为相对高度,短时间内有效
|
|
|
|
|
int setZAxisAngleToZero();//Z轴角度归零,只在切换成 6 轴算法下才能成功置零;
|
|
|
|
|
int setAngleReference();//问的技术支持,文档没有,不建议使用,设置后只能在静态下运动,即原点旋转单轴,其他方式旋转出来会有比较大的误差
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//范围
|
|
|
|
|
int setTimeZone(TIMEZONE_ENUM timeZone);
|
|
|
|
|
|
|
|
|
|
//设置回传内容:操作位??????????????????????
|
|
|
|
|
int latitudeLongitude();
|
|
|
|
|
int eulerAngle();
|
|
|
|
|
int setContent(RETURN_CONTENT_ENUM content);
|
|
|
|
|
int clearContent(RETURN_CONTENT_ENUM content);
|
|
|
|
|
|
|
|
|
|
//通讯
|
|
|
|
|
int SetBaudrate(BAUD_ENUM baudrate);
|
|
|
|
|
int SetReturnRate(RRATE_ENUM returnRate);
|
|
|
|
|
int SetDeviceAddress(int deviceAddress);//(1)只用于IIC协议,串口不用(2)设置、保存后,重新上电生效(3)最大为0x7f(124)
|
|
|
|
|
|
|
|
|
|
//接口
|
|
|
|
|
int setD0Model(MODEL_D0_D2_D3_ENUM model);
|
|
|
|
|
int setD1Model(MODEL_D1_ENUM model);
|
|
|
|
|
int setD2Model(MODEL_D0_D2_D3_ENUM model);
|
|
|
|
|
int setD3Model(MODEL_D0_D2_D3_ENUM model);
|
|
|
|
|
|
|
|
|
|
int setD0HighLevelPulseWidth(int PWMH);
|
|
|
|
|
int setD1HighLevelPulseWidth(int PWMH);
|
|
|
|
|
int setD2HighLevelPulseWidth(int PWMH);
|
|
|
|
|
int setD3HighLevelPulseWidth(int PWMH);
|
|
|
|
|
|
|
|
|
|
int setD0Period(int period);
|
|
|
|
|
int setD1Period(int period);
|
|
|
|
|
int setD2Period(int period);
|
|
|
|
|
int setD3Period(int period);
|
|
|
|
|
|
2022-05-29 23:24:27 +08:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
SerialPortBase * m_SerialPort;
|
2022-05-31 22:44:39 +08:00
|
|
|
|
int TIME_TO_SLEEP = 500;//毫秒
|
2022-05-29 23:24:27 +08:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // WITMOTIONDLL_H
|