mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -16,7 +16,7 @@
|
||||
#include "Constants.hpp"
|
||||
#include "ExampleSmartMotorController.hpp"
|
||||
|
||||
class DriveSubsystem : public frc2::SubsystemBase {
|
||||
class DriveSubsystem : public wpi::cmd::SubsystemBase {
|
||||
public:
|
||||
DriveSubsystem();
|
||||
|
||||
@@ -35,10 +35,10 @@ class DriveSubsystem : public frc2::SubsystemBase {
|
||||
* @param nextLeft The next left wheel state.
|
||||
* @param nextRight The next right wheel state.
|
||||
*/
|
||||
void SetDriveStates(frc::TrapezoidProfile<units::meters>::State currentLeft,
|
||||
frc::TrapezoidProfile<units::meters>::State currentRight,
|
||||
frc::TrapezoidProfile<units::meters>::State nextLeft,
|
||||
frc::TrapezoidProfile<units::meters>::State nextRight);
|
||||
void SetDriveStates(wpi::math::TrapezoidProfile<wpi::units::meters>::State currentLeft,
|
||||
wpi::math::TrapezoidProfile<wpi::units::meters>::State currentRight,
|
||||
wpi::math::TrapezoidProfile<wpi::units::meters>::State nextLeft,
|
||||
wpi::math::TrapezoidProfile<wpi::units::meters>::State nextRight);
|
||||
|
||||
/**
|
||||
* Drives the robot using arcade controls.
|
||||
@@ -58,14 +58,14 @@ class DriveSubsystem : public frc2::SubsystemBase {
|
||||
*
|
||||
* @return the average of the TWO encoder readings
|
||||
*/
|
||||
units::meter_t GetLeftEncoderDistance();
|
||||
wpi::units::meter_t GetLeftEncoderDistance();
|
||||
|
||||
/**
|
||||
* Gets the distance of the right encoder.
|
||||
*
|
||||
* @return the average of the TWO encoder readings
|
||||
*/
|
||||
units::meter_t GetRightEncoderDistance();
|
||||
wpi::units::meter_t GetRightEncoderDistance();
|
||||
|
||||
/**
|
||||
* Sets the max output of the drive. Useful for scaling the drive to drive
|
||||
@@ -82,7 +82,7 @@ class DriveSubsystem : public frc2::SubsystemBase {
|
||||
* @param distance The distance to drive forward.
|
||||
* @return A command.
|
||||
*/
|
||||
frc2::CommandPtr ProfiledDriveDistance(units::meter_t distance);
|
||||
wpi::cmd::CommandPtr ProfiledDriveDistance(wpi::units::meter_t distance);
|
||||
|
||||
/**
|
||||
* Creates a command to drive forward a specified distance using a motion
|
||||
@@ -91,14 +91,14 @@ class DriveSubsystem : public frc2::SubsystemBase {
|
||||
* @param distance The distance to drive forward.
|
||||
* @return A command.
|
||||
*/
|
||||
frc2::CommandPtr DynamicProfiledDriveDistance(units::meter_t distance);
|
||||
wpi::cmd::CommandPtr DynamicProfiledDriveDistance(wpi::units::meter_t distance);
|
||||
|
||||
private:
|
||||
frc::TrapezoidProfile<units::meters> m_profile{
|
||||
wpi::math::TrapezoidProfile<wpi::units::meters> m_profile{
|
||||
{DriveConstants::kMaxSpeed, DriveConstants::kMaxAcceleration}};
|
||||
frc::Timer m_timer;
|
||||
units::meter_t m_initialLeftDistance;
|
||||
units::meter_t m_initialRightDistance;
|
||||
wpi::Timer m_timer;
|
||||
wpi::units::meter_t m_initialLeftDistance;
|
||||
wpi::units::meter_t m_initialRightDistance;
|
||||
// Components (e.g. motor controllers and sensors) should generally be
|
||||
// declared private and exposed only through public methods.
|
||||
|
||||
@@ -109,10 +109,10 @@ class DriveSubsystem : public frc2::SubsystemBase {
|
||||
ExampleSmartMotorController m_rightFollower;
|
||||
|
||||
// A feedforward component for the drive
|
||||
frc::SimpleMotorFeedforward<units::meters> m_feedforward;
|
||||
wpi::math::SimpleMotorFeedforward<wpi::units::meters> m_feedforward;
|
||||
|
||||
// The robot's drive
|
||||
frc::DifferentialDrive m_drive{
|
||||
wpi::DifferentialDrive m_drive{
|
||||
[&](double output) { m_leftLeader.Set(output); },
|
||||
[&](double output) { m_rightLeader.Set(output); }};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user