CrossTheRoadElec / Phoenix-api

CTRE Phoenix language API (targets FIRST Robotics Competition, Linux, RaspPi, Windows)
Other
39 stars 28 forks source link

Velocity Mode for WPI Wrapper #11

Closed roshanr10 closed 6 years ago

roshanr10 commented 6 years ago

As requested by a few other teams, I wrote some basic code to allow configuration of the default mode used in the set() implementation of the SpeedController to allow velocity as well.

Given that it's such a small change, I thought I'd refactor and share it so additional teams may find it useful.

roshanr10 commented 6 years ago

Maybe establish a changeDefaultControlMode that ties into set? Part of why I did velocity is WPI SpeedController generally is used -1...1, this allows switching WPI voltage control to velocity control, once you specify the scale. This was intended primarily for teams passing their SRXs into drivetrain base classes, hence velocity.