Skip to content

Commit e1b02e0

Browse files
committed
Update telemetry measures
1 parent e3b0f26 commit e1b02e0

File tree

3 files changed

+66
-52
lines changed

3 files changed

+66
-52
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212

1313
subprojects {
1414
group = 'org.strykeforce.thirdcoast'
15-
version = '18.7.3'
15+
version = '18.7.4'
1616

1717
apply plugin: 'java-library'
1818
apply plugin: 'idea'

telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/grapher/Measure.kt

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,44 @@ package org.strykeforce.thirdcoast.telemetry.grapher
22

33
/** Available telemetry measurement types. */
44
enum class Measure constructor(val description: String) {
5-
UNKNOWN("Unknown Measurement"),
6-
CLOSED_LOOP_TARGET("Closed-loop Setpoint"),
75

86
// BaseMotorController
9-
OUTPUT_CURRENT("Output Current"),
10-
OUTPUT_VOLTAGE("Output Voltage"),
7+
BASE_ID("Base ID"),
8+
BUS_VOLTAGE("Bus Voltage"),
9+
CLOSED_LOOP_ERROR("Closed Loop Error (PID 0)"),
10+
CLOSED_LOOP_TARGET("Closed-loop Setpoint (PID 0)"),
11+
CONTROL_MODE("Control Mode"),
12+
DEVICE_ID("Device ID"),
13+
ERROR_DERIVATIVE("Error Derivative (PID 0)"),
14+
FIRMWARE_VERSION("Firmware Version"),
15+
INTEGRAL_ACCUMULATOR("Integral Accumulator (PID 0)"),
1116
OUTPUT_PERCENT("Output Percentage"),
12-
SELECTED_SENSOR_POSITION("Selected Sensor Position"),
13-
SELECTED_SENSOR_VELOCITY("Selected Sensor Velocity"),
17+
OUTPUT_VOLTAGE("Output Voltage"),
18+
OUTPUT_CURRENT("Output Current"),
19+
SELECTED_SENSOR_POSITION("Selected Sensor Position (PID 0)"),
20+
SELECTED_SENSOR_VELOCITY("Selected Sensor Velocity (PID 0)"),
21+
ACTIVE_TRAJECTORY_HEADING("Active Trajectory Heading"),
1422
ACTIVE_TRAJECTORY_POSITION("Active Trajectory Position"),
1523
ACTIVE_TRAJECTORY_VELOCITY("Active Trajectory Velocity"),
16-
// ACTIVE_TRAJECTORY_HEADING("Active Trajectory Heading"),
17-
CLOSED_LOOP_ERROR("Closed Loop Error"),
18-
BUS_VOLTAGE("Bus Voltage"),
19-
ERROR_DERIVATIVE("Error Derivative"),
20-
INTEGRAL_ACCUMULATOR("Integral Accumulator"),
21-
// TODO: add motion profile
2224

2325
// TalonSRX SensorCollection
24-
ANALOG_IN("Analog Input"),
25-
ANALOG_RAW("Analog Raw Input"),
26-
ANALOG_POSITION("Analog Position"),
27-
ANALOG_VELOCITY("Analog Velocity"),
28-
QUAD_POSITION("Quadrature Position"),
29-
QUAD_VELOCITY("Quadrature Velocity"),
30-
QUAD_A_PIN("Quadrature A State"),
31-
QUAD_B_PIN("Quadrature B State"),
32-
QUAD_IDX_PIN("Quadrature Index State"),
26+
ANALOG_IN("Analog Position Input"),
27+
ANALOG_IN_RAW("Analog Raw Input"),
28+
ANALOG_IN_VELOCITY("Analog Velocity Input"),
29+
QUAD_A_PIN("Quad A Pin State"),
30+
QUAD_B_PIN("Quad B Pin State"),
31+
QUAD_IDX_PIN("Quad Index Pin State"),
3332
PULSE_WIDTH_POSITION("Pulse Width Position"),
34-
PULSE_WIDTH_VELOCITY("Pulse Width Velocity"),
3533
PULSE_WIDTH_RISE_TO_FALL("PWM Pulse Width"),
3634
PULSE_WIDTH_RISE_TO_RISE("PWM Period"),
35+
PULSE_WIDTH_VELOCITY("Pulse Width Velocity"),
36+
QUAD_POSITION("Quadrature Position"),
37+
QUAD_VELOCITY("Quadrature Velocity"),
3738
FORWARD_LIMIT_SWITCH_CLOSED("Forward Limit Switch Closed"),
3839
REVERSE_LIMIT_SWITCH_CLOSED("Reverse Limit Switch Closed"),
3940
// FORWARD_SOFT_LIMIT("Forward Soft Limit"),
4041
// REVERSE_SOFT_LIMIT("Reverse Soft Limit"),
4142

42-
ANGLE("Angle"),
43-
POSITION("Position"),
44-
// SPEED("Speed"),
45-
VALUE("Value"),
46-
47-
// Swerve
48-
GYRO_YAW("Gyro Yaw"),
49-
GYRO_YAW_RATE("Gyro Yaw Rate (deg/sec)"),
50-
SWERVE_FORWARD("Swerve Forward"),
51-
SWERVE_STRAFE("Swerve Strafe"),
52-
SWERVE_AZIMUTH("Swerve Azimuth"),
53-
54-
// PathFinder
55-
PATH_SEG_X("Trajectory X Coordinate"),
56-
PATH_SEG_Y("Trajectory Y Coordinate"),
57-
PATH_SEG_POSITION_METERS("Trajectory Position (meters)"),
58-
PATH_SEG_POSITION_TICKS("Trajectory Position (ticks)"),
59-
PATH_SEG_VELOCITY("Trajectory Velocity"),
60-
PATH_SEG_ACCELERATION("Trajectory Acceleration"),
61-
PATH_SEG_JERK("Trajectory Jerk"),
62-
PATH_SEG_HEADING("Trajectory Heading"),
63-
PATH_DISTANCE("Distance Travelled"),
64-
PATH_POSITION_ERROR("Path Position Error"),
65-
6643
// Canifier
6744
PWM0_PULSE_WIDTH("PWM 0 Pulse Width"),
6845
PWM0_PERIOD("PWM 0 Period"),
@@ -76,4 +53,42 @@ enum class Measure constructor(val description: String) {
7653
PWM3_PULSE_WIDTH("PWM 3 Pulse Width"),
7754
PWM3_PERIOD("PWM 3 Period"),
7855
PWM3_PULSE_WIDTH_POSITION("PWM 3 Pulse Width Position"),
56+
57+
// General
58+
DISPLACEMENT_X("X Displacement"),
59+
DISPLACEMENT_Y("Y Displacement"),
60+
DISPLACEMENT_Z("Z Displacement"),
61+
ROTATION_X("X Rotation (Roll)"),
62+
ROTATION_Y("Y Rotation (Pitch)"),
63+
ROTATION_Z("Z Rotation (Yaw)"),
64+
ROTATION_RATE_X("X Rotation Rate (Roll)"),
65+
ROTATION_RATE_Y("Y Rotation Rate (Pitch)"),
66+
ROTATION_RATE_Z("Z Rotation Rate (Yaw)"),
67+
68+
COMPONENT_FORWARD("Forward Component"),
69+
COMPONENT_STRAFE("Strafe Component"),
70+
COMPONENT_YAW("Yaw Component"),
71+
72+
DISPLACEMENT_EXPECTED("Expected Displacement"),
73+
DISPLACEMENT_ACTUAL("Actual Displacement"),
74+
DISPLACEMENT_ERROR("Displacement Error"),
75+
VELOCITY_EXPECTED("Expected Velocity"),
76+
VELOCITY_ACTUAL("Actual Velocity"),
77+
VELOCITY_ERROR("Velocity Error"),
78+
ACCELERATION_EXPECTED("Expected Acceleration"),
79+
ACCELERATION_ACTUAL("Actual Acceleration"),
80+
ACCELERATION_ERROR("Acceleration Error"),
81+
JERK_EXPECTED("Expected Jerk"),
82+
JERK_ACTUAL("Actual Jerk"),
83+
JERK_ERROR("Jerk Error"),
84+
85+
ENCODER_EXPECTED("Expected Encoder Value"),
86+
ENCODER_ACTUAL("Actual Encoder Value"),
87+
ENCODER_ERROR("Encoder Value Error"),
88+
89+
POSITION("Position"),
90+
RANGE("Range"),
91+
ANGLE("Angle"),
92+
VALUE("Measured Value"),
93+
UNKNOWN("Unknown Measurement"),
7994
}

telemetry/src/main/kotlin/org/strykeforce/thirdcoast/telemetry/item/TalonItem.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class TalonItem @JvmOverloads constructor(
3434
ERROR_DERIVATIVE -> DoubleSupplier { talon.getErrorDerivative(0) }
3535
INTEGRAL_ACCUMULATOR -> DoubleSupplier { talon.getIntegralAccumulator(0) }
3636
ANALOG_IN -> DoubleSupplier { sensorCollection.analogIn.toDouble() }
37-
ANALOG_RAW -> DoubleSupplier { sensorCollection.analogInRaw.toDouble() }
38-
ANALOG_VELOCITY -> DoubleSupplier { sensorCollection.analogInVel.toDouble() }
37+
ANALOG_IN_RAW -> DoubleSupplier { sensorCollection.analogInRaw.toDouble() }
38+
ANALOG_IN_VELOCITY -> DoubleSupplier { sensorCollection.analogInVel.toDouble() }
3939
QUAD_POSITION -> DoubleSupplier { sensorCollection.quadraturePosition.toDouble() }
4040
QUAD_VELOCITY -> DoubleSupplier { sensorCollection.quadratureVelocity.toDouble() }
4141
QUAD_A_PIN -> DoubleSupplier { sensorCollection.pinStateQuadA.toDouble() }
@@ -79,9 +79,8 @@ class TalonItem @JvmOverloads constructor(
7979
ERROR_DERIVATIVE,
8080
INTEGRAL_ACCUMULATOR,
8181
ANALOG_IN,
82-
ANALOG_RAW,
83-
ANALOG_POSITION,
84-
ANALOG_VELOCITY,
82+
ANALOG_IN_RAW,
83+
ANALOG_IN_VELOCITY,
8584
QUAD_POSITION,
8685
QUAD_VELOCITY,
8786
QUAD_A_PIN,

0 commit comments

Comments
 (0)