mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 17:49:33 +00:00
Use radians macro, minor change
This commit is contained in:
parent
1ed05a94dd
commit
f4aaf0f4f3
@ -27,10 +27,10 @@
|
||||
#define PITCH_I ROLL_I
|
||||
#define PITCH_D ROLL_D
|
||||
#define YAW_P 3
|
||||
#define PITCHRATE_MAX 360 * DEG_TO_RAD
|
||||
#define ROLLRATE_MAX 360 * DEG_TO_RAD
|
||||
#define YAWRATE_MAX 360 * DEG_TO_RAD
|
||||
#define MAX_TILT 30 * DEG_TO_RAD
|
||||
#define PITCHRATE_MAX radians(360)
|
||||
#define ROLLRATE_MAX radians(360)
|
||||
#define YAWRATE_MAX radians(360)
|
||||
#define MAX_TILT radians(30)
|
||||
|
||||
#define RATES_LFP_ALPHA 0.8 // cutoff frequency ~ 250 Hz
|
||||
#define RATES_D_LPF_ALPHA 0.2 // cutoff frequency ~ 40 Hz
|
||||
|
@ -39,5 +39,5 @@ void applyAcc() {
|
||||
|
||||
void signalizeHorizontality() {
|
||||
float angle = Vector::angleBetweenVectors(attitude.rotate(Vector(0, 0, -1)), Vector(0, 0, -1));
|
||||
setLED(angle < 15 * DEG_TO_RAD);
|
||||
setLED(angle < radians(15));
|
||||
}
|
||||
|
@ -11,10 +11,10 @@
|
||||
#define WIFI_ENABLED 0
|
||||
|
||||
#define RC_CHANNELS 6
|
||||
#define RC_CHANNEL_ROLL 0
|
||||
#define RC_CHANNEL_PITCH 1
|
||||
#define RC_CHANNEL_THROTTLE 2
|
||||
#define RC_CHANNEL_YAW 3
|
||||
#define RC_CHANNEL_PITCH 1
|
||||
#define RC_CHANNEL_ROLL 0
|
||||
#define RC_CHANNEL_AUX 4
|
||||
#define RC_CHANNEL_MODE 5
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
||||
#define PI 3.1415926535897932384626433832795
|
||||
#define DEG_TO_RAD 0.017453292519943295769236907684886
|
||||
#define RAD_TO_DEG 57.295779513082320876798154814105
|
||||
#define radians(deg) ((deg)*DEG_TO_RAD)
|
||||
#define degrees(rad) ((rad)*RAD_TO_DEG)
|
||||
|
||||
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user