z1_controller/include/control/CtrlComponents.h

55 lines
1.3 KiB
C
Raw Normal View History

2023-04-26 16:15:59 +08:00
#ifndef CTRLCOMPONENTS_H
#define CTRLCOMPONENTS_H
#include <string>
#include <iostream>
#include "common/utilities/loop.h"
#include "message/arm_common.h"
#include "message/LowlevelCmd.h"
#include "message/LowlevelState.h"
#include "common/utilities/CSVTool.h"
#include "model/ArmModel.h"
#include "interface/IOUDP.h"
#include "control/armSDK.h"
2023-05-17 18:24:12 +08:00
#include "model/unitree_gripper.h"
2023-04-26 16:15:59 +08:00
using namespace std;
struct CtrlComponents{
public:
CtrlComponents(int argc, char**argv);
~CtrlComponents();
std::string armConfigPath;
CmdPanel *cmdPanel;
IOInterface *ioInter;
Z1Model *armModel;
CSVTool *stateCSV;
2023-05-17 18:24:12 +08:00
std::shared_ptr<Unitree_Gripper> gripper;
2023-05-25 21:01:46 +08:00
double gripper_max_tau = 10;
2023-04-26 16:15:59 +08:00
SendCmd sendCmd; // cmd that receive from SDK
RecvState recvState;// state that send to SDK
//config
double dt;
bool *running;
Control ctrl = Control::SDK;
bool hasGripper;
bool isCollisionOpen;
double collisionTLimit;
bool isPlot;
int trajChoose = 1;
size_t armType = 36;
2023-05-25 21:01:46 +08:00
std::string ctrl_IP;
uint ctrl_port;
2023-04-26 16:15:59 +08:00
void geneObj();
void writeData();
private:
void configProcess(int argc, char** argv);
double _loadWeight;
};
2022-07-20 11:11:38 +08:00
#endif // CTRLCOMPONENTS_H