Giter VIP home page Giter VIP logo

yagsl-control-mockup's Introduction

Yet Another Generic Swerve Library (YAGSL) Example project

YAGSL is intended to be an easy implementation of a generic swerve drive that should work for most square swerve drives. The project is documented on here. The JSON documentation can also be found here

This example is intended to be a starting place on how to use YAGSL. By no means is this intended to be the base of your robot project. YAGSL provides an easy way to generate a SwerveDrive which can be used in both TimedRobot and Command-Based Robot templates.

Overview

Installation

Vendor URL:

https://broncbotz3481.github.io/YAGSL-Lib/yagsl/yagsl.json

Javadocs here
Library here
Code here
WIKI
Config Generation

Create an issue if there is any errors you find!

We will be actively montoring this and fix any issues when we can!

Development

  • Development happens here on YAGSL-Example. YAGSL and YAGSL-Lib are updated on a nightly basis.

Support our developers!

Buy Me a Robot at ko-fi.com

TL;DR Generate and download your configuration here and unzip it so that it follows structure below:

deploy
└── swerve
    ├── controllerproperties.json
    ├── modules
    │   ├── backleft.json
    │   ├── backright.json
    │   ├── frontleft.json
    │   ├── frontright.json
    │   ├── physicalproperties.json
    │   └── pidfproperties.json
    └── swervedrive.json

Then create your SwerveDrive object like this.

import java.io.File;
import edu.wpi.first.wpilibj.Filesystem;
import swervelib.parser.SwerveParser;
import swervelib.SwerveDrive;
import edu.wpi.first.math.util.Units;


SwerveDrive swerveDrive=new SwerveParser(new File(Filesystem.getDeployDirectory(),"swerve")).createSwerveDrive(Units.feetToMeters(14.5));

Migrating Old Configuration Files

  1. Delete wheelDiamter, gearRatio, encoderPulsePerRotation from physicalproperties.json
  2. Add optimalVoltage to physicalproperties.json
  3. Delete maxSpeed and optimalVoltage from swervedrive.json
  4. IF a swerve module doesn't have the same drive motor or steering motor as the rest of the swerve drive you MUST specify a conversionFactor for BOTH the drive and steering motor in the modules configuration JSON file. IF one of the motors is the same as the rest of the swerve drive and you want to use that conversionFactor, set the conversionFactor in the module JSON configuration to 0.
  5. You MUST specify the maximum speed when creating a SwerveDrive through new SwerveParser(directory).createSwerveDrive(maximumSpeed);
  6. IF you do not want to set conversionFactor in swervedrive.json. You can pass it into the constructor as a parameter like this
double DriveConversionFactor = SwerveMath.calculateMetersPerRotation(Units.inchesToMeters(WHEEL_DIAMETER), GEAR_RATIO, ENCODER_RESOLUTION);
double SteeringConversionFactor = SwerveMath.calculateDegreesPerSteeringRotation(GEAR_RATIO, ENCODER_RESOLUTION);
SwerveDrive swerveDrive = new SwerveParser(directory).createSwerveDrive(maximumSpeed, SteeringConversionFactor, DriveConversionFactor);

Falcon Support would not have been possible without support from Team 1466 Webb Robotics!

Configuration Tips

My Robot Spins around uncontrollably during autonomous or when attempting to set the heading!

  • Invert the gyro scope.
  • Invert the drive motors for every module. (If front and back become reversed when turning)

Angle motors are erratic.

  • Invert the angle motor.

My robot is heavy.

  • Implement momentum velocity limitations in SwerveMath.

Ensure the IMU is centered on the robot

yagsl-control-mockup's People

Contributors

5010tigerdynasty avatar 7910f6ba7ee4 avatar ajs256 avatar clrozeboom avatar dwooll94 avatar dylan-watson avatar flint221 avatar geraldtm avatar josephtlockwood avatar jwbonner avatar natfletch avatar technologyman00 avatar thenetworkgrinch 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.