-
Notifications
You must be signed in to change notification settings - Fork 16
/
ctrlComponents.h
37 lines (32 loc) · 1.02 KB
/
ctrlComponents.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef CTRLCOMPONENTS_H
#define CTRLCOMPONENTS_H
#include "unitree_arm_sdk/message/arm_common.h"
#include "unitree_arm_sdk/message/LowlevelCmd.h"
#include "unitree_arm_sdk/message/LowlevelState.h"
#include "unitree_arm_sdk/message/udp.h"
#include "unitree_arm_sdk/utilities/loop.h"
#include "unitree_arm_sdk/model/ArmModel.h"
namespace UNITREE_ARM {
struct CtrlComponents{
public:
CtrlComponents();
CtrlComponents(double deltaT, bool hasUnitreeGripper);
~CtrlComponents();
/*
* Function: send udp message to z1_ctrl and receive udp message from it
* Input: None
* Output: None
* Description: The function will call udp->send() to send datas in lowcmd to z1_ctrl
* and call udp->recv() to store datas from z1_ctrl into lowstate
*/
void sendRecv();
LowlevelCmd *lowcmd;
LowlevelState *lowstate;
double dt;// default: 0.002
SendCmd sendCmd; // udp command to control the arm
RecvState recvState; // the arm state receive from udp
ArmModel* armModel;
UDPPort *udp;
};
}
#endif