blob: eb1ef63195a2e9a51eb9f35eac3fdb3d94b036b0 [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05002/* Copyright (c) FIRST 2014-2016. All Rights Reserved. */
Brian Silverman26e4e522015-12-17 01:56:40 -05003/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#pragma once
9
10#include <cstdint>
11
12class TestBench {
13 public:
14 /* Analog input channels */
15 static const uint32_t kCameraGyroChannel = 0;
16 static const uint32_t kFakeCompressorChannel = 1;
17 static const uint32_t kFakeAnalogOutputChannel = 2;
18
19 /* Analog output channels */
20 static const uint32_t kAnalogOutputChannel = 0;
21 static const uint32_t kFakeJaguarPotentiometer = 1;
22
23 /* DIO channels */
24 static const uint32_t kTalonEncoderChannelA = 0;
25 static const uint32_t kTalonEncoderChannelB = 1;
26 static const uint32_t kVictorEncoderChannelA = 2;
27 static const uint32_t kVictorEncoderChannelB = 3;
28 static const uint32_t kJaguarEncoderChannelA = 4;
29 static const uint32_t kJaguarEncoderChannelB = 5;
30 static const uint32_t kLoop1OutputChannel = 6;
31 static const uint32_t kLoop1InputChannel = 7;
32 static const uint32_t kLoop2OutputChannel = 8;
33 static const uint32_t kLoop2InputChannel = 9;
34
35 /* PWM channels */
36 static const uint32_t kVictorChannel = 1;
37 static const uint32_t kJaguarChannel = 2;
38 static const uint32_t kCameraPanChannel = 8;
39 static const uint32_t kCameraTiltChannel = 9;
40
41 /* MXP digital channels */
42 static const uint32_t kTalonChannel = 10;
43 static const uint32_t kFakePressureSwitchChannel = 11;
44 static const uint32_t kFakeSolenoid1Channel = 12;
45 static const uint32_t kFakeSolenoid2Channel = 13;
46 static const uint32_t kFakeRelayForward = 18;
47 static const uint32_t kFakeRelayReverse = 19;
48 static const uint32_t kFakeJaguarForwardLimit = 20;
49 static const uint32_t kFakeJaguarReverseLimit = 21;
50
51 /* Relay channels */
52 static const uint32_t kRelayChannel = 0;
53 static const uint32_t kCANJaguarRelayChannel = 1;
54
55 /* CAN IDs */
56 static const uint32_t kCANJaguarID = 2;
57
58 /* PDP channels */
59 static const uint32_t kJaguarPDPChannel = 6;
60 static const uint32_t kVictorPDPChannel = 8;
Brian Silverman1a675112016-02-20 20:42:49 -050061 static const uint32_t kTalonPDPChannel = 10;
Brian Silverman26e4e522015-12-17 01:56:40 -050062
63 /* PCM channels */
64 static const int32_t kSolenoidChannel1 = 0;
65 static const int32_t kSolenoidChannel2 = 1;
Brian Silverman1a675112016-02-20 20:42:49 -050066
67 /* Filter constants */
68 static constexpr double kFilterStep = 0.005;
69 static constexpr double kFilterTime = 2.0;
70 static constexpr double kSinglePoleIIRTimeConstant = 0.015915;
71 static constexpr double kSinglePoleIIRExpectedOutput = -3.2172003;
72 static constexpr double kHighPassTimeConstant = 0.006631;
73 static constexpr double kHighPassExpectedOutput = 10.074717;
74 static constexpr int kMovAvgTaps = 6;
75 static constexpr double kMovAvgExpectedOutput = -10.191644;
Brian Silverman26e4e522015-12-17 01:56:40 -050076};