haustorial/prosthesis_controller/behaviour.h

43 lines
No EOL
891 B
C

#ifndef BEHAVIOUR_H_
#define BEHAVIOUR_H_
#include "SimplexNoise.h" //Library from https://github.com/jshaw/SimplexNoise
#include "definitions.h"
#include "servo.h"
extern dxl_servo servos[SERVO_COUNT];
#define SERVO_COUNT_MAIN 3
#define SERVO_COUNT_PERIPHERAL 3
#define WEIGHT_COUNT 7 //enter number of weights here for array size
#define WEIGHT_UPDATE_INTERVAL 100
#define SERVOWEIGHT_UPDATE_INTERVAL SERVO_UPDATE_INTERVAL
#define W_PITCH 0
#define W_ROLL 1
#define W_NOISE 2
#define W_NOISESLOW 3
#define W_SIN 4
#define W_COS 5
#define W_LOOKDIRECTION 6
struct Mood{
float shakiness;
float wakefulness;
float loneliness;
};
extern Mood mood;
void updateMatrixWeights(unsigned long millis,bool body_present, bool contact_main);
void updateServosByWeights(unsigned long millis);
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max);
#endif