/
Setup.h
116 lines (89 loc) · 4.15 KB
/
Setup.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef __Setup__
#define __Setup__
#include "AnimationManager.h"
class Setup {
public:
void setValues(
AnimationManager* theAnimationManager,
Motor* motor
) {
/*
make sure debug is false before running on motor this is only for simulation mode
*/
DEBUG = true;
motor->homing = false;
/*
Choose one of
PREVIEW,
CYCLE,
RANDOM
*/
theAnimationManager->mode = RANDOM;
/*
Choose one of
DAY,
NIGHT,
CLOCK
*/
theAnimationManager->timeMode = CLOCK;
theAnimationManager->amp = 0.4;
// Setup animation manager transition speed
theAnimationManager->transition.speed = 0.08; //0.25;
// Setup propabilities
theAnimationManager->baseStill.propability = 0.5; // any value bigger than 0
theAnimationManager->randomStill.propability = 1.0; // any value bigger than 0
theAnimationManager->jitterStill.propability = 0.9; // any value bigger than 0
theAnimationManager->randomMove.propability = 3.0; // any value bigger than 0
theAnimationManager->jitterMove.propability = 0.0001; // any value bigger than 0
theAnimationManager->fullRoll.propability = 1.5; // any value bigger than 0
theAnimationManager->randomRoll.propability = 0.75; // any value bigger than 0
// Setup BASE_STILL animation
theAnimationManager->baseStill.minDuration = 30; // any value bigger than 0
theAnimationManager->baseStill.maxDuration = 45; // any value bigger than 0
// Setup RANDOM_STILL animation
theAnimationManager->randomStill.minDuration = 20; // any value bigger than 0
theAnimationManager->randomStill.maxDuration = 37.5; // any value bigger than 0
// Setup JITTER_STILL animation
theAnimationManager->jitterStill.minDuration = 7.5; // any value bigger than 0
theAnimationManager->jitterStill.maxDuration = 15; // any value bigger than 0
theAnimationManager->jitterStill.jitterAmplitude = 0.013; // jitter amount relative range 0 to 0.25 def 0.1
theAnimationManager->jitterStill.jitterFrequency = 0.55; // movements per second max dependent on amp def 0.5
theAnimationManager->jitterStill.jitterFade = 0.12; // range 0.1 to 0.5 def 0.1
// Setup RANDOM_MOVE animation
theAnimationManager->randomMove.minCycles = 3; // any value bigger than 0
theAnimationManager->randomMove.maxCycles = 6; // any value bigger than 0
theAnimationManager->randomMove.speed = 0.125; // 0.2
theAnimationManager->randomMove.breakTime = 6; // any value
theAnimationManager->randomMove.breakTimeRandom = 0.7; // range 0. to 1.
//Setup JITTER_MOVE animation
theAnimationManager->jitterMove.minCycles = 1;
theAnimationManager->jitterMove.maxCycles = 1;
theAnimationManager->jitterMove.jitterAmplitude = 0.05; //def 0.1
theAnimationManager->jitterMove.jitterFade = 0.5; //def 0.5
theAnimationManager->jitterMove.jitterFrequency = 0.15; //def 0.5
theAnimationManager->jitterMove.speed = 0.2; //def 5
theAnimationManager->jitterMove.breakTime = 4.5;
theAnimationManager->jitterMove.breakTimeRandom = 0.2;
// Setup FULL_ROLL animation
theAnimationManager->fullRoll.frequency = 0.1; // max value 0.1
theAnimationManager->fullRoll.minCycles = 1;
theAnimationManager->fullRoll.maxCycles = 1;
// Setup RANDOM_ROLL animation
theAnimationManager->randomRoll.minCycles = 1; // any value bigger than 0
theAnimationManager->randomRoll.maxCycles = 1; // any value bigger than 0
theAnimationManager->randomRoll.speed = 0.1; // value bigger than 3
theAnimationManager->randomRoll.minAmp = 0.55; // value 0. to 1
/*
Choose one of
BASE_STILL,
RANDOM_STILL,
JITTER_STILL,
RANDOM_MOVE,
JITTER_MOVE,
FULL_ROLL,
RANDOM_ROLL
*/
theAnimationManager->animation(FULL_ROLL);
}
};
#endif