Giter Site home page Giter Site logo

swerve-template's Introduction

Configuring the code for your robot

  1. Set your team number.
  2. Read through and configure frc.robot.Constants. Parts of the code that need to be configured for your specific robot setup are marked with comments starting with FIXME.

Don't configure the *_MODULE_STEER_OFFSET constants yet. Those are configured after code is deployed.

  1. Read through and configure frc.robot.subsystems.DrivetrainSubsystem. Parts of the code that need to be configured for your specific robot setup are marked with comments starting with FIXME.
  2. At this point deploy the code. If it endlessly crashes at startup make sure your CAN IDs are properly set and make sure you are using the proper swerve module configurations for your hardware.

Setting up module offsets

Now that we have code running on the robot, we can set up our module steering offsets. In order to do this we must have our encoder values displayed to the dashboard.

Before setting up module offsets ensure each offset is set to -Math.toRadians(0.0) and that code is deployed to the robot. This must be done each time offsets are determined.

  1. Turn the robot on its side, so it is easy to move each module by hand.

By default, module sensor information is displayed in the Drivetrain tab on ShuffleBoard.

  1. Rotate each module so the bevel gear on the sides of each wheel are pointing to the robot's left.

When aligning the wheels they must be as straight as possible. It is recommended to use a long straight edge such as a piece of 2x1 in order to make the wheels straight.

  1. Record the angles of each module using the reading displayed on the dashboard.

  2. Set the values of the *_MODULE_STEER_OFFSET constants in Constants to -Math.toRadians(<the angle you recorded>)

  3. Re-deploy and try to drive the robot forwards. All wheels should stay parallel to each other.

  4. Make sure all the wheels are spinning in the correct direction. If not, add 180 degrees to the offset of each wheel that is spinning in the incorrect direction. (I.e. -Math.toRadians(<angle> + 180.0)))

swerve-template's People

Contributors

jacobjbublitz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.