📄 ipm.h
字号:
#ifndef _IPM_H_
#define _IPM_H_ 1
#include "stdafx.h"
#include <stdlib.h>
#include <atlbase.h>
#include <comdef.h>
#include <stdio.h>
#include <initguid.h>
#include ".\dctmc\DCTMotionControlSystem.h"
#define SERIAL_RS485 1
#define OUTPUT_9 9 /*射门装置高电频输出口 */
#define ENABLE 1
#define LOW 0
#define ACCELERATION 4 /*加速度 */
const WORD adr_ASPD = 0x22C; // address of the ASPD TML variable - measured speed
class Ipm {
private:
bool bIPMOk; /*控制板是否初始化成功*/
int COM_NUM; /*使用的串口 */
int RIGHT_AXISID; /*右轴号 */
int LEFT_AXISID; /*左轴号 */
int KICKER_AXISID; /*踢球机构与那个轴相连接 */
IDCTMotionControlSystem* sys ;
IDCTMCNetInterface* netif ;
IDCTMotionController* ctrl ;
IDCTMCAxis* axisL ;
IDCTMCAxis* axisR ;
public:
Ipm();
~Ipm();
bool initIpm(); /*初始化ipm板 */
bool LoadConfig(const char * filename); /*读取配置文件 */
//void ShowIPMErrMsg(); /*错误输出*/
bool SendToIPM(); /*把左右轮速发送到ipm板上 */
void quit(); /*退出,设置速度为0 */
//int readASPD(); /*读取实际速度 */
//bool DetectBlock(double lwset, double rwset); /*检测机器人是否堵转*/
void axisOff(); /*把机器人poweroff */
void axisOn(); /*机器人poweron */
void kickerOn(); /*打开踢球机构 */
void kickerOff(); /*关闭踢球机构 */
double lv; /*左轮速 */
double rv; /*右轮速 */
//bool bLBlocking; /*左轮是否堵转 */
//bool bRBlocking; /*右轮是否堵转 */
bool bKicking; /*踢球机构是否处于打开状态 */
double R_ASPD,L_ASPD; /*左右轮的实际速度 */
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -