We also need to write the relevant initialization code for the PIDController. We will set these up in the constructor, taking in two integers for the motor ports, one integer for the encoder port, and using default values for the PIDController.
Start by making private instance variables for the speedMotor, angleMotor, and pidController. This will consist of two motors for angle and speed (can be Jaguars or Talons, we will use Jaguars) as well as an angle encoder that we will use to setup the PIDController. The SwerveDrive class needs to represent the swerve modules that are on the real robot. This is where the angle and speed values generated from the SwerveDrive class will go. Tasks involved modifications to the CheesyDrive code from 2012 and mapping the gamepad axes to the drivetrain, and reimaging the cRIO to v47.
#Frc driver station github drivers#
This class will be instantiated four times for each of the wheels on the drivetrain. Students worked on reviving the 2010 robot’s drivebase to have our drivers (Abhi Kumar and Chris Sides) driving as soon as possible to practice with the Logitech F310 controller. Users outside of FRC: Please note that you.
#Frc driver station github software#
This means that the 2016 Driver Station Software presently distributed by FIRST does not work properly with any cRIO imaged with a 2014 image in the default configuration.
This latest iteration of the popular Talon platform from Cross the Road Electronics adds support for CAN, additional communication protocols, and integrated PID control. Driver Station The cRIOs base image for C++ speaks an older version of the Driver Station <> Robot Controller network protocol than what the 2015/2016 roboRIO does.In your IDE, add a new class to your project and call it WheelDrive. The Talon SRX offers the latest in smart speed controller technology compressed into a robust, compact package. This will involve setting up a PIDController and converting the angle values into voltage ranges. It is also important to note that the book assumes the swerve modules will be operated alongside an angle encoder. This is where some of the code becomes module dependent, so this book will do the best job possible of explaining the possible changes one would have to make. Now that we understand how swerve drive works and we have a framework for converting joystick input into swerve relative values, we can begin the process of using those values to operate the actual swerve modules.
Driving the Motors 2.1 - Writing the WheelDrive Class