Make channels definition to rc.ino

It's also planned to parametrize them later
This commit is contained in:
Oleg Kalachev
2025-01-10 09:37:48 +03:00
parent 568f9dd5b1
commit 821e6b105e
10 changed files with 54 additions and 55 deletions

View File

@@ -17,7 +17,7 @@ float t = NAN;
float dt;
float motors[4];
int16_t channels[16]; // raw rc channels
float controls[RC_CHANNELS];
float controls[16];
float controlsTime;
Vector acc;
Vector gyro;

View File

@@ -7,13 +7,6 @@
#include <gazebo/gazebo.hh>
#include <iostream>
#define RC_CHANNEL_ROLL 0
#define RC_CHANNEL_PITCH 1
#define RC_CHANNEL_THROTTLE 2
#define RC_CHANNEL_YAW 3
#define RC_CHANNEL_ARMED 5
#define RC_CHANNEL_MODE 4
SDL_Joystick *joystick;
bool joystickInit() {

View File

@@ -72,8 +72,8 @@ public:
// read rc
readRC();
controls[RC_CHANNEL_MODE] = 1; // 0 acro, 1 stab
controls[RC_CHANNEL_ARMED] = 1; // armed
controls[modeChannel] = 1; // 0 acro, 1 stab
controls[armedChannel] = 1; // armed
estimate();