mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-07-23 14:41:25 +00:00
fixed servo center and initialized both lc and lc_processed
This commit is contained in:
@@ -52,11 +52,11 @@ void testGimbal(PWMServo &yaw, PWMServo &pitch) {
|
||||
|
||||
// Servo 1 Test
|
||||
for (servoTest = 0; servoTest < 7; servoTest += 1) {
|
||||
yaw.write(yaw_conv(90 + servoTest));
|
||||
yaw.write(yaw_conv(servoTest));
|
||||
delay(30);
|
||||
}
|
||||
for (servoTest = 7; servoTest >= 1; servoTest -= 1) {
|
||||
yaw.write(yaw_conv(90 + servoTest));
|
||||
yaw.write(yaw_conv(servoTest));
|
||||
delay(30);
|
||||
}
|
||||
|
||||
@@ -64,11 +64,11 @@ void testGimbal(PWMServo &yaw, PWMServo &pitch) {
|
||||
|
||||
// Servo 2 Test
|
||||
for (servoTest = 0; servoTest < 7; servoTest += 1) {
|
||||
pitch.write(pitch_conv(90 + servoTest));
|
||||
pitch.write(pitch_conv(servoTest));
|
||||
delay(30);
|
||||
}
|
||||
for (servoTest = 7; servoTest >= 1; servoTest -= 1) {
|
||||
pitch.write(pitch_conv(90 + servoTest));
|
||||
pitch.write(pitch_conv(servoTest));
|
||||
delay(30);
|
||||
}
|
||||
|
||||
@@ -76,13 +76,13 @@ void testGimbal(PWMServo &yaw, PWMServo &pitch) {
|
||||
|
||||
// Servo 1 & 2 Test
|
||||
for (servoTest = 0; servoTest < 7; servoTest += 1) {
|
||||
yaw.write(yaw_conv(90 + servoTest));
|
||||
pitch.write(pitch_conv(90 + servoTest));
|
||||
yaw.write(yaw_conv(servoTest));
|
||||
pitch.write(pitch_conv(servoTest));
|
||||
delay(30);
|
||||
}
|
||||
for (servoTest = 7; servoTest >= 1; servoTest -= 1) {
|
||||
yaw.write(yaw_conv(90 + servoTest));
|
||||
pitch.write(pitch_conv(90 + servoTest));
|
||||
yaw.write(yaw_conv(servoTest));
|
||||
pitch.write(pitch_conv(servoTest));
|
||||
delay(30);
|
||||
}
|
||||
|
||||
@@ -130,10 +130,15 @@ void initLoadCells(Vehicle &State) {
|
||||
Serial.println("Load Cells Initialized");
|
||||
|
||||
// Initializes State variables
|
||||
State.lc0 = 9.81 * 0.001 * lc0.get_value() / lcGain0;
|
||||
State.lc1 = 9.81 * 0.001 * lc1.get_value() / lcGain1;
|
||||
State.lc2 = 9.81 * 0.001 * lc2.get_value() / lcGain2;
|
||||
State.lc3 = 9.81 * 0.001 * lc3.get_value() / lcGain3;
|
||||
State.lc0 = lc0.get_value();
|
||||
State.lc1 = lc1.get_value();
|
||||
State.lc2 = lc2.get_value();
|
||||
State.lc3 = lc3.get_value();
|
||||
|
||||
State.lc0_processed = 9.81 * 0.001 * lc0.get_value() / lcGain0;
|
||||
State.lc1_processed = 9.81 * 0.001 * lc1.get_value() / lcGain1;
|
||||
State.lc2_processed = 9.81 * 0.001 * lc2.get_value() / lcGain2;
|
||||
State.lc3_processed = 9.81 * 0.001 * lc3.get_value() / lcGain3;
|
||||
}
|
||||
|
||||
void initFile() {
|
||||
|
Reference in New Issue
Block a user