2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2019-08-25 23:55:59 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-11-15 17:33:18 -08:00
|
|
|
#include <wpi/math>
|
|
|
|
|
|
2019-08-25 23:55:59 -04:00
|
|
|
/**
|
|
|
|
|
* The Constants header provides a convenient place for teams to hold robot-wide
|
|
|
|
|
* numerical or bool constants. This should not be used for any other purpose.
|
|
|
|
|
*
|
|
|
|
|
* It is generally a good idea to place constants into subsystem- or
|
|
|
|
|
* command-specific namespaces within this header, which can then be used where
|
|
|
|
|
* they are needed.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace DriveConstants {
|
2019-10-27 19:32:56 -07:00
|
|
|
constexpr int kLeftMotor1Port = 0;
|
|
|
|
|
constexpr int kLeftMotor2Port = 1;
|
|
|
|
|
constexpr int kRightMotor1Port = 2;
|
|
|
|
|
constexpr int kRightMotor2Port = 3;
|
|
|
|
|
|
|
|
|
|
constexpr int kLeftEncoderPorts[]{0, 1};
|
|
|
|
|
constexpr int kRightEncoderPorts[]{2, 3};
|
|
|
|
|
constexpr bool kLeftEncoderReversed = false;
|
|
|
|
|
constexpr bool kRightEncoderReversed = true;
|
|
|
|
|
|
|
|
|
|
constexpr int kEncoderCPR = 1024;
|
|
|
|
|
constexpr double kWheelDiameterInches = 6;
|
|
|
|
|
constexpr double kEncoderDistancePerPulse =
|
2019-08-25 23:55:59 -04:00
|
|
|
// Assumes the encoders are directly mounted on the wheel shafts
|
2019-11-15 17:33:18 -08:00
|
|
|
(kWheelDiameterInches * wpi::math::pi) / static_cast<double>(kEncoderCPR);
|
2019-08-25 23:55:59 -04:00
|
|
|
} // namespace DriveConstants
|
|
|
|
|
|
|
|
|
|
namespace HatchConstants {
|
2019-10-27 19:32:56 -07:00
|
|
|
constexpr int kHatchSolenoidModule = 0;
|
|
|
|
|
constexpr int kHatchSolenoidPorts[]{0, 1};
|
2019-08-25 23:55:59 -04:00
|
|
|
} // namespace HatchConstants
|
|
|
|
|
|
|
|
|
|
namespace AutoConstants {
|
2019-10-27 19:32:56 -07:00
|
|
|
constexpr double kAutoDriveDistanceInches = 60;
|
|
|
|
|
constexpr double kAutoBackupDistanceInches = 20;
|
2019-11-20 21:48:16 -08:00
|
|
|
constexpr double kAutoDriveSpeed = 0.5;
|
2019-08-25 23:55:59 -04:00
|
|
|
} // namespace AutoConstants
|
|
|
|
|
|
|
|
|
|
namespace OIConstants {
|
2019-10-27 19:32:56 -07:00
|
|
|
constexpr int kDriverControllerPort = 1;
|
2019-08-25 23:55:59 -04:00
|
|
|
} // namespace OIConstants
|