Junior commit.
Changed range constants.
Change-Id: Ibcea5ddf00a0ea65f2d8a46a9612732dfbd705f4
diff --git a/y2016_bot3/control_loops/drivetrain/drivetrain_base.cc b/y2016_bot3/control_loops/drivetrain/drivetrain_base.cc
index e6d2bc2..403c215 100644
--- a/y2016_bot3/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2016_bot3/control_loops/drivetrain/drivetrain_base.cc
@@ -38,7 +38,7 @@
true,
0.0,
0.25,
- 1.0};
+ 0.50};
return kDrivetrainConfig;
};
diff --git a/y2016_bot3/control_loops/intake/intake.cc b/y2016_bot3/control_loops/intake/intake.cc
index d3d288b..b3d86af 100644
--- a/y2016_bot3/control_loops/intake/intake.cc
+++ b/y2016_bot3/control_loops/intake/intake.cc
@@ -16,7 +16,7 @@
// The maximum voltage the intake roller will be allowed to use.
constexpr float kMaxIntakeTopVoltage = 12.0;
constexpr float kMaxIntakeBottomVoltage = 12.0;
-
+constexpr float kMaxIntakeRollersVoltage = 12.0;
}
// namespace
@@ -140,10 +140,10 @@
requested_intake = unsafe_goal->angle_intake;
}
- //Push the request out to the hardware.
+ // Push the request out to the hardware.
limit_checker_.UpdateGoal(requested_intake);
- // ESTOP if we hit the hard limits.
+ // ESTOP if we hit the hard limits.
if (intake_.CheckHardLimits() && output) {
state_ = ESTOP;
}
@@ -176,6 +176,7 @@
output->voltage_top_rollers = 0.0;
output->voltage_bottom_rollers = 0.0;
+ output->voltage_intake_rollers = 0.0;
if (unsafe_goal) {
// Ball detector lights.
@@ -190,6 +191,10 @@
output->voltage_top_rollers = ::std::max(
-kMaxIntakeTopVoltage,
::std::min(unsafe_goal->voltage_top_rollers, kMaxIntakeTopVoltage));
+ output->voltage_intake_rollers =
+ ::std::max(-kMaxIntakeRollersVoltage,
+ ::std::min(unsafe_goal->voltage_intake_rollers,
+ kMaxIntakeRollersVoltage));
output->voltage_bottom_rollers =
::std::max(-kMaxIntakeBottomVoltage,
::std::min(unsafe_goal->voltage_bottom_rollers,
@@ -200,7 +205,6 @@
}
// Traverse.
- output->traverse_unlatched = unsafe_goal->traverse_unlatched;
output->traverse_down = unsafe_goal->traverse_down;
}
}
diff --git a/y2016_bot3/control_loops/intake/intake.h b/y2016_bot3/control_loops/intake/intake.h
index a5b4da6..57d8f84 100644
--- a/y2016_bot3/control_loops/intake/intake.h
+++ b/y2016_bot3/control_loops/intake/intake.h
@@ -29,18 +29,19 @@
// the use.
// TODO(constants): Update these.
static constexpr ::frc971::constants::Range kIntakeRange{// Lower hard stop
- -0.5,
+ -0.4,
// Upper hard stop
- 2.90,
+ 2.80,
// Lower soft stop
- -0.300,
+ -0.28,
// Uppper soft stop
- 2.725};
+ 2.77};
struct IntakeZero {
- double pot_offset = 0.0;
- ::frc971::constants::ZeroingConstants zeroing{
- kZeroingSampleSize, kIntakeEncoderIndexDifference, 0.0, 0.3};
+ double pot_offset = 5.462409 + 0.333162;
+ ::frc971::constants::ZeroingConstants zeroing{kZeroingSampleSize,
+ kIntakeEncoderIndexDifference,
+ +(-0.291240 + 0.148604), 0.3};
};
} // namespace constants
namespace control_loops {
@@ -56,11 +57,12 @@
// TODO(Adam): Implement this class and delete it from here.
class LimitChecker {
- public:
- LimitChecker(IntakeArm *intake) : intake_(intake) {}
- void UpdateGoal(double intake_angle_goal);
- private:
- IntakeArm *intake_;
+ public:
+ LimitChecker(IntakeArm *intake) : intake_(intake) {}
+ void UpdateGoal(double intake_angle_goal);
+
+ private:
+ IntakeArm *intake_;
};
class Intake : public ::aos::controls::ControlLoop<control_loops::IntakeQueue> {
@@ -137,7 +139,6 @@
DISALLOW_COPY_AND_ASSIGN(Intake);
};
-
} // namespace intake
} // namespace control_loops
} // namespace y2016_bot3
diff --git a/y2016_bot3/control_loops/intake/intake.q b/y2016_bot3/control_loops/intake/intake.q
index b6b0bdc..55d102d 100644
--- a/y2016_bot3/control_loops/intake/intake.q
+++ b/y2016_bot3/control_loops/intake/intake.q
@@ -57,12 +57,10 @@
// Voltage to send to the rollers. Positive is sucking in.
float voltage_top_rollers;
float voltage_bottom_rollers;
+ float voltage_intake_rollers;
bool force_intake;
- // If true, release the latch which holds the traverse mechanism in the
- // middle.
- bool traverse_unlatched;
// If true, fire the traverse mechanism down.
bool traverse_down;
};
@@ -77,7 +75,6 @@
// The internal state of the state machine.
int32_t state;
-
// Estimated angle and angular velocitie of the intake.
JointState intake;
};
@@ -93,9 +90,8 @@
float voltage_top_rollers;
float voltage_bottom_rollers;
+ float voltage_intake_rollers;
- // If true, release the latch to hold the traverse mechanism in the middle.
- bool traverse_unlatched;
// If true, fire the traverse mechanism down.
bool traverse_down;
};