Merge "Type fixes to uart.h (take span)"
diff --git a/y2019/constants.cc b/y2019/constants.cc
index d77d2c7..e2d54b3 100644
--- a/y2019/constants.cc
+++ b/y2019/constants.cc
@@ -110,7 +110,7 @@
stilts_params->zeroing_voltage = 3.0;
stilts_params->operating_voltage = 12.0;
stilts_params->zeroing_profile_params = {0.1, 0.5};
- stilts_params->default_profile_params = {0.1, 0.5};
+ stilts_params->default_profile_params = {0.15, 0.5};
stilts_params->range = Values::kStiltsRange();
stilts_params->make_integral_loop =
&control_loops::superstructure::stilts::MakeIntegralStiltsLoop;
@@ -138,8 +138,8 @@
break;
case kCompTeamNumber:
- elevator_params->zeroing_constants.measured_absolute_position = 0.019470;
- elevator->potentiometer_offset = -0.075017;
+ elevator_params->zeroing_constants.measured_absolute_position = 0.024407;
+ elevator->potentiometer_offset = -0.075017 + 0.015837 + 0.009793 - 0.012017;
intake->zeroing_constants.measured_absolute_position = 1.860016;
@@ -151,8 +151,8 @@
break;
case kPracticeTeamNumber:
- elevator_params->zeroing_constants.measured_absolute_position = 0.160767;
- elevator->potentiometer_offset = -0.022320 + 0.020567 - 0.022355;
+ elevator_params->zeroing_constants.measured_absolute_position = 0.167722;
+ elevator->potentiometer_offset = -0.022320 + 0.020567 - 0.022355 - 0.006497;
intake->zeroing_constants.measured_absolute_position = 1.756847;
diff --git a/y2019/constants.h b/y2019/constants.h
index 24d8b92..a3af890 100644
--- a/y2019/constants.h
+++ b/y2019/constants.h
@@ -93,7 +93,7 @@
static constexpr ::frc971::constants::Range kElevatorRange() {
return ::frc971::constants::Range{
- -0.01, // Bottom Hard
+ -0.02, // Bottom Hard
1.62, // Top Hard
0.01, // Bottom Soft
1.59 // Top Soft
diff --git a/y2019/control_loops/superstructure/vacuum.h b/y2019/control_loops/superstructure/vacuum.h
index 3fd5a49..d2acf97 100644
--- a/y2019/control_loops/superstructure/vacuum.h
+++ b/y2019/control_loops/superstructure/vacuum.h
@@ -20,7 +20,7 @@
static constexpr double kPumpVoltage = 8.0;
// Voltage to the vaccum pump when we have a piece
- static constexpr double kPumpHasPieceVoltage = 2.0;
+ static constexpr double kPumpHasPieceVoltage = 2.25;
// Time to continue at the higher pump voltage after getting a gamepiece
static constexpr aos::monotonic_clock::duration kTimeAtHigherVoltage =
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index 17cc45f..310f41f 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -45,7 +45,7 @@
const ButtonLocation kElevatorBack5(4, 6);
const ButtonLocation kElevatorIntaking(3, 4);
-const ButtonLocation kElevatorIntakingUp(3, 6);
+const ButtonLocation kElevatorOuttake(3, 6);
const ButtonLocation kRelease(4, 4);
const ButtonLocation kSuctionBall(3, 13);
@@ -186,10 +186,14 @@
}
// TODO(sabina): max height please?
- if (data.IsPressed(kDeployStilt)) {
- new_superstructure_goal->stilts.unsafe_goal = 0.50;
- } else if (data.IsPressed(kFallOver)) {
+ if (data.IsPressed(kFallOver)) {
new_superstructure_goal->stilts.unsafe_goal = 0.71;
+ new_superstructure_goal->stilts.profile_params.max_velocity = 0.45;
+ new_superstructure_goal->stilts.profile_params.max_acceleration = 0.5;
+ } else if (data.IsPressed(kDeployStilt)) {
+ new_superstructure_goal->stilts.unsafe_goal = 0.50;
+ new_superstructure_goal->stilts.profile_params.max_velocity = 0.45;
+ new_superstructure_goal->stilts.profile_params.max_acceleration = 0.5;
} else {
new_superstructure_goal->stilts.unsafe_goal = 0.01;
}
@@ -239,14 +243,18 @@
wrist_angle_ = 0.0;
elevator_height_ = 0.36;
}
- //if (data.IsPressed(kElevatorIntaking)) {
- //}
+
+ if (data.IsPressed(kElevatorOuttake) ||
+ (data.IsPressed(kIntakeOut) &&
+ !superstructure_queue.status->has_piece)) {
+ new_superstructure_goal->intake.unsafe_goal = 0.959327;
+ }
+
if (data.IsPressed(kIntakeOut) && !superstructure_queue.status->has_piece) {
elevator_height_ = 0.29;
wrist_angle_ = 2.14;
- new_superstructure_goal->intake.unsafe_goal = 0.52;
if (data.IsPressed(kElevatorIntaking)) {
- new_superstructure_goal->roller_voltage = 6.0;
+ new_superstructure_goal->roller_voltage = 9.0;
} else {
new_superstructure_goal->roller_voltage = 0.0;
}
@@ -256,9 +264,29 @@
new_superstructure_goal->roller_voltage = 0.0;
}
- if (data.IsPressed(kElevatorIntakingUp)) {
- elevator_height_ = 0.29 + 0.3;
- wrist_angle_ = 2.14;
+ if (data.IsPressed(kElevatorOuttake)) {
+ new_superstructure_goal->roller_voltage = -6.0;
+ }
+
+ if (data.IsPressed(kElevatorBack1)) {
+ wrist_angle_ = -2.451824;
+ elevator_height_ = 0.430478;
+ //new_superstructure_goal->wrist.profile_params.max_velocity = 2.0;
+ //new_superstructure_goal->wrist.profile_params.max_acceleration = 20.0;
+ }
+ if (data.IsPressed(kElevatorBack2)) {
+ wrist_angle_ = -2.400;
+ elevator_height_ = 0.364108;
+ new_superstructure_goal->elevator.profile_params.max_velocity = 2.0;
+ new_superstructure_goal->elevator.profile_params.max_acceleration = 5.0;
+ new_superstructure_goal->wrist.profile_params.max_velocity = 0.35;
+ new_superstructure_goal->wrist.profile_params.max_acceleration = 10.0;
+ }
+ if (data.IsPressed(kElevatorBack3)) {
+ wrist_angle_ = -2.211173;
+ elevator_height_ = 0.25;
+ new_superstructure_goal->wrist.profile_params.max_velocity = 2.0;
+ new_superstructure_goal->wrist.profile_params.max_acceleration = 10.0;
}
diff --git a/y2019/wpilib_interface.cc b/y2019/wpilib_interface.cc
index 2efb55b..193aaa9 100644
--- a/y2019/wpilib_interface.cc
+++ b/y2019/wpilib_interface.cc
@@ -359,7 +359,7 @@
void set_intake_roller_talon(
::std::unique_ptr<::ctre::phoenix::motorcontrol::can::TalonSRX> t) {
intake_rollers_talon_ = ::std::move(t);
- intake_rollers_talon_->ConfigContinuousCurrentLimit(20.0, 0);
+ intake_rollers_talon_->ConfigContinuousCurrentLimit(10.0, 0);
intake_rollers_talon_->EnableCurrentLimit(true);
}