z1_controller/include/control/CtrlComponents.h

49 lines
1020 B
C
Raw Normal View History

2022-07-20 11:11:38 +08:00
#ifndef CTRLCOMPONENTS_H
#define CTRLCOMPONENTS_H
2022-11-11 19:49:41 +08:00
#include <string>
#include <iostream>
#include "common/utilities/loop.h"
#include "message/arm_common.h"
2022-07-20 11:11:38 +08:00
#include "message/LowlevelCmd.h"
#include "message/LowlevelState.h"
#include "common/utilities/CSVTool.h"
2022-11-11 19:49:41 +08:00
#include "model/ArmModel.h"
#include "interface/IOUDP.h"
#include "interface/IOROS.h"
#include "control/armSDK.h"
using namespace std;
2022-07-20 11:11:38 +08:00
struct CtrlComponents{
public:
2022-09-13 19:53:15 +08:00
CtrlComponents();
~CtrlComponents();
2022-07-20 11:11:38 +08:00
std::string armConfigPath;
2022-11-11 19:49:41 +08:00
CmdPanel *cmdPanel;
2022-07-20 11:11:38 +08:00
IOInterface *ioInter;
2022-11-11 19:49:41 +08:00
ArmModel *armModel;
2022-07-20 11:11:38 +08:00
CSVTool *stateCSV;
2022-11-11 19:49:41 +08:00
SendCmd sendCmd; // cmd that receive from SDK
RecvState recvState;// state that send to SDK
2022-09-13 19:53:15 +08:00
//config
2022-07-20 11:11:38 +08:00
double dt;
bool *running;
2022-11-11 19:49:41 +08:00
Control ctrl;
bool hasGripper;
bool isCollisionOpen;
double collisionTLimit;
bool isPlot;
2022-07-20 11:11:38 +08:00
2022-09-13 19:53:15 +08:00
void geneObj();
void writeData();
2022-07-20 11:11:38 +08:00
private:
2022-11-11 19:49:41 +08:00
std::string ctrl_IP;
uint ctrl_port;
double _loadWeight;
2022-07-20 11:11:38 +08:00
};
#endif // CTRLCOMPONENTS_H