mirror of
https://github.com/okalachev/flix.git
synced 2025-07-28 20:08:53 +00:00
Make simulator read RC through real drone code
This commit is contained in:
parent
476f24f774
commit
48ea797a47
@ -9,5 +9,8 @@ class SBUS {
|
|||||||
public:
|
public:
|
||||||
SBUS(HardwareSerial& bus) {};
|
SBUS(HardwareSerial& bus) {};
|
||||||
void begin() {};
|
void begin() {};
|
||||||
bool read(int16_t* channels, bool* failsafe, bool* lostFrame) { joystickGet(); return true; }; // NOTE: on the hardware channels is uint16_t
|
bool read(int16_t* channels, bool* failsafe, bool* lostFrame) { // NOTE: on the hardware channels is uint16_t
|
||||||
|
joystickGet();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -54,6 +54,4 @@ void joystickGet() {
|
|||||||
}
|
}
|
||||||
channels[RC_CHANNEL_MODE] = SDL_JoystickGetButton(joystick, 0) ? 1 : 0;
|
channels[RC_CHANNEL_MODE] = SDL_JoystickGetButton(joystick, 0) ? 1 : 0;
|
||||||
controls[RC_CHANNEL_MODE] = channels[RC_CHANNEL_MODE];
|
controls[RC_CHANNEL_MODE] = channels[RC_CHANNEL_MODE];
|
||||||
|
|
||||||
normalizeRC();
|
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
acc = this->accFilter.update(flu2frd(imu->LinearAcceleration()));
|
acc = this->accFilter.update(flu2frd(imu->LinearAcceleration()));
|
||||||
|
|
||||||
// read rc
|
// read rc
|
||||||
joystickGet();
|
readRC();
|
||||||
controls[RC_CHANNEL_MODE] = 1; // 0 acro, 1 stab
|
controls[RC_CHANNEL_MODE] = 1; // 0 acro, 1 stab
|
||||||
controls[RC_CHANNEL_AUX] = 1; // armed
|
controls[RC_CHANNEL_AUX] = 1; // armed
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user