59 lines
784 B
C
59 lines
784 B
C
//Data.h Data Structure
|
|
|
|
#ifndef DATA
|
|
#define DATA
|
|
|
|
#include "Arduino.h"
|
|
#include "Def.h"
|
|
#include "SerD.h"
|
|
|
|
// LAYOUT
|
|
// _U_
|
|
// 0==/ \==3
|
|
// >***<
|
|
// 1===|---|===4
|
|
// >***<
|
|
// 2==\___/==5
|
|
|
|
struct Data
|
|
{
|
|
int HeadTime;
|
|
int WalkTime;
|
|
SerD ServoData[6];
|
|
float HeadAngle;
|
|
|
|
//IK
|
|
int HeadPosition;
|
|
float l3;
|
|
float s;
|
|
|
|
//Init
|
|
Data()
|
|
{
|
|
HeadAngle = 0;
|
|
|
|
ServoData[0](5, 3, 8);
|
|
ServoData[1](8, 3, 0);
|
|
ServoData[2](5, 3, -8);
|
|
ServoData[3](5, 3, 8);
|
|
ServoData[4](8, 3, 0);
|
|
ServoData[5](5, 3, -8);
|
|
}
|
|
|
|
void input (DataObject* R)
|
|
{
|
|
ServoData[0] = R->S0;
|
|
ServoData[1] = R->S1;
|
|
ServoData[2] = R->S2;
|
|
ServoData[3] = R->S3;
|
|
ServoData[4] = R->S4;
|
|
ServoData[5] = R->S5;
|
|
}
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|