Merge "Adding checkboxes for auto cargo picked up"
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index 4c94670..3db5f72 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -58,14 +58,6 @@
this.level = 'Transversal';
}
- setClimbedTrue() {
- this.climbed = true;
- }
-
- setClimbedFalse() {
- this.climbed = false;
- }
-
nextSection() {
if (this.section === 'Team Selection') {
this.section = 'Auto';
diff --git a/scouting/www/entry/entry.ng.html b/scouting/www/entry/entry.ng.html
index eae74ce..c5cf233 100644
--- a/scouting/www/entry/entry.ng.html
+++ b/scouting/www/entry/entry.ng.html
@@ -73,9 +73,9 @@
<div *ngSwitchCase="'Climb'" id="climb" class="container-fluid">
<div class="row">
<form>
- <input [ngModel]="climbed" (click)="setClimbedFalse()" type="radio" name="climbing" id="continue" value="true">
+ <input [(ngModel)]="climbed" type="radio" name="climbing" id="continue" [value]="false">
<label for="continue">Kept Shooting</label><br>
- <input [ngModel]="climbed" (click)="setClimbedTrue()" type="radio" name="climbing" id="climbed" value="false">
+ <input [(ngModel)]="climbed" type="radio" name="climbing" id="climbed" [value]="true">
<label for="climbed">Attempted to Climb</label><br>
</form>
</div>
diff --git a/y2022/constants.cc b/y2022/constants.cc
index 34ffae2..980735f 100644
--- a/y2022/constants.cc
+++ b/y2022/constants.cc
@@ -161,10 +161,10 @@
intake_back->subsystem_params.zeroing_constants
.measured_absolute_position = 0.280099007470002;
- turret->potentiometer_offset =
- -9.99970387166721 + 0.06415943 + 0.073290115367682;
+ turret->potentiometer_offset = -9.99970387166721 + 0.06415943 +
+ 0.073290115367682 - 0.0634440443622909;
turret->subsystem_params.zeroing_constants.measured_absolute_position =
- 0.511895084051468;
+ 0.568649928102931;
flipper_arm_left->potentiometer_offset = -6.4;
flipper_arm_right->potentiometer_offset = 5.56;
diff --git a/y2022/constants.h b/y2022/constants.h
index e3bc93f..ffe1283 100644
--- a/y2022/constants.h
+++ b/y2022/constants.h
@@ -113,7 +113,7 @@
.lower_hard = -6.0, // Back Hard
.upper_hard = 4.0, // Front Hard
.lower = -5.0, // Back Soft
- .upper = 3.7 // Front Soft
+ .upper = 3.3 // Front Soft
};
}
diff --git a/y2022/control_loops/superstructure/catapult/catapult.cc b/y2022/control_loops/superstructure/catapult/catapult.cc
index fda62ad..4a644e2 100644
--- a/y2022/control_loops/superstructure/catapult/catapult.cc
+++ b/y2022/control_loops/superstructure/catapult/catapult.cc
@@ -313,7 +313,7 @@
const flatbuffers::Offset<
frc971::control_loops::PotAndAbsoluteEncoderProfiledJointStatus>
Catapult::Iterate(const Goal *unsafe_goal, const Position *position,
- double *catapult_voltage, bool fire,
+ double battery_voltage, double *catapult_voltage, bool fire,
flatbuffers::FlatBufferBuilder *fbb) {
const frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemGoal
*catapult_goal = unsafe_goal != nullptr && unsafe_goal->has_catapult()
@@ -373,8 +373,9 @@
} else {
// TODO(austin): Voltage error?
CHECK_NOTNULL(catapult_voltage);
- *catapult_voltage =
- std::max(0.0, std::min(12.0, *solution - 0.0 * next_X(2, 0)));
+ *catapult_voltage = std::max(
+ 0.0, std::min(12.0, (*solution - 0.0 * next_X(2, 0)) * 12.0 /
+ std::max(battery_voltage, 8.0)));
use_profile_ = false;
}
} else {
@@ -396,8 +397,10 @@
}
case CatapultState::RESETTING:
- if (catapult_.controller().R(1, 0) > 0.0) {
- catapult_.AdjustProfile(7.0, 1400.0);
+ if (catapult_.controller().R(1, 0) > 7.0) {
+ catapult_.AdjustProfile(7.0, 2000.0);
+ } else if (catapult_.controller().R(1, 0) > 0.0) {
+ catapult_.AdjustProfile(7.0, 1000.0);
} else {
catapult_state_ = CatapultState::PROFILE;
}
@@ -420,8 +423,9 @@
}
}
- catapult_.UpdateObserver(catapult_voltage != nullptr ? *catapult_voltage
- : 0.0);
+ catapult_.UpdateObserver(catapult_voltage != nullptr
+ ? (*catapult_voltage * battery_voltage / 12.0)
+ : 0.0);
return catapult_.MakeStatus(fbb);
}
diff --git a/y2022/control_loops/superstructure/catapult/catapult.h b/y2022/control_loops/superstructure/catapult/catapult.h
index ccd4b06..0606c0d 100644
--- a/y2022/control_loops/superstructure/catapult/catapult.h
+++ b/y2022/control_loops/superstructure/catapult/catapult.h
@@ -211,7 +211,7 @@
const flatbuffers::Offset<
frc971::control_loops::PotAndAbsoluteEncoderProfiledJointStatus>
Iterate(const Goal *unsafe_goal, const Position *position,
- double *catapult_voltage, bool fire,
+ double battery_voltage, double *catapult_voltage, bool fire,
flatbuffers::FlatBufferBuilder *fbb);
private:
diff --git a/y2022/control_loops/superstructure/superstructure.cc b/y2022/control_loops/superstructure/superstructure.cc
index c87cc95..0b693ef 100644
--- a/y2022/control_loops/superstructure/superstructure.cc
+++ b/y2022/control_loops/superstructure/superstructure.cc
@@ -394,12 +394,12 @@
// Disable the catapult if we want to restart to prevent damage with
// flippers
const flatbuffers::Offset<PotAndAbsoluteEncoderProfiledJointStatus>
- catapult_status_offset =
- catapult_.Iterate(unsafe_goal, position,
- output != nullptr && !catapult_.estopped()
- ? &(output_struct.catapult_voltage)
- : nullptr,
- fire_, status->fbb());
+ catapult_status_offset = catapult_.Iterate(
+ unsafe_goal, position, robot_state().voltage_battery(),
+ output != nullptr && !catapult_.estopped()
+ ? &(output_struct.catapult_voltage)
+ : nullptr,
+ fire_, status->fbb());
const flatbuffers::Offset<RelativeEncoderProfiledJointStatus>
climber_status_offset = climber_.Iterate(
diff --git a/y2022/wpilib_interface.cc b/y2022/wpilib_interface.cc
index a1b1202..69883b4 100644
--- a/y2022/wpilib_interface.cc
+++ b/y2022/wpilib_interface.cc
@@ -701,13 +701,6 @@
AddLoop(&output_event_loop);
- // Thread 5
- ::aos::ShmEventLoop can_sensor_reader_event_loop(&config.message());
- CANSensorReader can_sensor_reader(&can_sensor_reader_event_loop);
- can_sensor_reader.set_flipper_arms_falcon(
- superstructure_writer.flipper_arms_falcon());
- AddLoop(&can_sensor_reader_event_loop);
-
RunLoops();
}
};