Add Constants.cpp for MecanumControllerCommand example (#2196)

This commit is contained in:
Peter Johnson
2019-12-24 16:19:02 -06:00
committed by GitHub
parent 0c6f24562f
commit 93cdf68694
2 changed files with 18 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 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 "Constants.h"
namespace DriveConstants {
const frc::MecanumDriveKinematics kDriveKinematics{
frc::Translation2d(kWheelBase / 2, kTrackWidth / 2),
frc::Translation2d(kWheelBase / 2, -kTrackWidth / 2),
frc::Translation2d(-kWheelBase / 2, kTrackWidth / 2),
frc::Translation2d(-kWheelBase / 2, -kTrackWidth / 2)};
} // namespace DriveConstants

View File

@@ -22,12 +22,6 @@
using namespace DriveConstants;
const frc::MecanumDriveKinematics DriveConstants::kDriveKinematics{
frc::Translation2d(kWheelBase / 2, kTrackWidth / 2),
frc::Translation2d(kWheelBase / 2, -kTrackWidth / 2),
frc::Translation2d(-kWheelBase / 2, kTrackWidth / 2),
frc::Translation2d(-kWheelBase / 2, -kTrackWidth / 2)};
RobotContainer::RobotContainer() {
// Initialize all of your commands and subsystems here