FireFly 2012: start of a behaviour-based rewrite (unfinished, does not compile)

From 'FireFly 19.rar'.
This commit is contained in:
mangavalk committed 2012-07-19 20:51:25 +02:00
1 parent 0911543c03
commit f0b272a1d3
10 files changed
+685

No files matched your search

@@ -0,0 +1,71 @@
//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
{
//MAIN
// Pointers to classes
//hexapod FireFly;
//Watchdog
boolean Send;
double LastSendTime;
int WalkTime;
int HeadTime; //100
//Converter
SerD ServoData[6];
float HeadAngle;
int ReadyToSend;
//IK
int HeadPosition;
boolean ReadyToConvert;
float l3;
float s;
//Init
Data()
{
LastSendTime = 0;
HeadAngle = 0;
HeadTime = 100;
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);
}
Data& operator() (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