Merge changes I633ce2c8,I1d3d7543
* changes:
Updated info on bazel setup command
Refactored Joystick Reader and Updated 2019.
diff --git a/frc971/control_loops/python/path_edit.py b/frc971/control_loops/python/path_edit.py
index 9edbb47..52bd8d1 100644
--- a/frc971/control_loops/python/path_edit.py
+++ b/frc971/control_loops/python/path_edit.py
@@ -144,7 +144,6 @@
self.selected_points = []
self.splines = []
- self.spline = []
self.reinit_extents()
self.inStart = None
@@ -204,8 +203,6 @@
self.startSet = True
else:
self.inEnd = [self.index_of_edit, self.findDistance()]
- self.spline[self.spline_edit].addConstraint(
- self.inStart, self.inEnd, self.inConstraint, self.inValue)
self.startSet = False
self.mode = Mode.kEditing
self.spline_edit = -1
@@ -237,7 +234,7 @@
set_color(cr, palette["GREY"])
cr.paint()
#Scale the field to fit within drawing area
- cr.scale(0.5,0.5)
+ cr.scale(0.5, 0.5)
# Draw a extents rectangle
set_color(cr, palette["WHITE"])
@@ -277,14 +274,6 @@
cr.fill()
y = 0
- for x, i in enumerate(self.spline):
- for j in i.constraints:
- cr.move_to(-650, -y * 10 + 320)
- set_color(cr, palette["BLACK"])
- display_text(
- cr, str("Spline " + str(x) + ": " + str(j.toString())),
- 0.5, 0.5, 2, 2)
- y += 1
# update all the things
@@ -489,9 +478,6 @@
self.splines[spline_edit][1] = f * 2 + e * -1
self.splines[spline_edit][2] = d + f * 4 + e * -4
- self.spline[spline_edit].point = self.splines[spline_edit]
- self.spline[spline_edit].math()
-
if not self.spline_edit == 0:
spline_edit = self.spline_edit - 1
a = self.splines[self.spline_edit][0]
@@ -501,11 +487,6 @@
self.splines[spline_edit][4] = a * 2 + b * -1
self.splines[spline_edit][3] = c + a * 4 + b * -4
- self.spline[spline_edit].point = self.splines[spline_edit]
- self.spline[spline_edit].math()
-
- self.spline[self.spline_edit].edit(self.index_of_edit,
- [self.x, self.y])
self.index_of_edit = -1
self.spline_edit = -1
else:
@@ -641,4 +622,4 @@
window = GridWindow()
-basic_window.RunApp()
+basic_window.RunApp()
\ No newline at end of file
diff --git a/frc971/wpilib/ahal/Spark.cc b/frc971/wpilib/ahal/Spark.cc
new file mode 100644
index 0000000..9127931
--- /dev/null
+++ b/frc971/wpilib/ahal/Spark.cc
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
+#include "frc971/wpilib/ahal/Spark.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+Spark::Spark(int channel) : PWM(channel) {
+ /* Note that the Spark uses the following bounds for PWM values. These values
+ * should work reasonably well for most controllers, but if users experience
+ * issues such as asymmetric behavior around the deadband or inability to
+ * saturate the controller in either direction, calibration is recommended.
+ * The calibration procedure can be found in the Spark User Manual available
+ * from REV Robotics.
+ *
+ * 2.003ms = full "forward"
+ * 1.55ms = the "high end" of the deadband range
+ * 1.50ms = center of the deadband range (off)
+ * 1.46ms = the "low end" of the deadband range
+ * 0.999ms = full "reverse"
+ */
+ SetBounds(2.003, 1.55, 1.50, 1.46, .999);
+ SetPeriodMultiplier(kPeriodMultiplier_1X);
+ SetSpeed(0.0);
+ SetZeroLatch();
+
+ HAL_Report(HALUsageReporting::kResourceType_RevSPARK, GetChannel());
+}
diff --git a/frc971/wpilib/ahal/Spark.h b/frc971/wpilib/ahal/Spark.h
new file mode 100644
index 0000000..f33130b
--- /dev/null
+++ b/frc971/wpilib/ahal/Spark.h
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2008-2017. All Rights Reserved. */
+/* Open Source Software - may be modified and shared by FRC teams. The code */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project. */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "frc971/wpilib/ahal/PWM.h"
+
+namespace frc {
+
+/**
+ * Vex Robotics Victor SP Speed Controller
+ */
+class Spark : public PWM {
+ public:
+ explicit Spark(int channel);
+ virtual ~Spark() = default;
+};
+
+} // namespace frc