YAGSL
  • Welcome to Yet Another Swerve Document
    • Resources
  • Overview
    • What we do
    • Our Features
      • Telemetry
      • Simulation
      • Lock Pose
      • Max Speed
      • Chassis Speed Discretization
      • Vision Odometry
      • Heading Correction
      • Auto-centering Modules
      • Offset Offloading
      • Cosine Compensation
      • Module Auto-synchronization
      • Angular Velocity Compensation
    • Changelog
    • Java API
    • Example Code
    • Config Generator
    • 💸Donations
    • 👕Merch
    • Discord
  • Fundamentals
    • Swerve Drive
    • Swerve Modules
  • Bringing up swerve
    • Preface
    • Swerve Information
    • Check your gyroscope
    • Check your motors
    • Creating your first configuration
  • Configuring YAGSL
    • Getting to know your robot
      • Gear Ratio
    • Dependency Installation
    • Configuration
      • Swerve Drive Configuration
      • Physical Properties Configuration
      • PIDF Properties Configuration
        • PIDF
      • Swerve Module Configuration
      • Controller Properties Configuration
      • Device Configuration
    • Code Setup
    • Standard Conversion Factors
    • How to tune PIDF
    • When to invert?
    • Flowcharts
    • The eight steps
    • Swerve Drive Drift
    • SparkMAX Common Problems
    • Verifying your Module Locations
    • Tuning out Drift
  • Devices
    • Gyroscope
      • NavX
      • Pigeon
      • Pigeon 2.0
      • ADXRS450
      • ADIS16448
      • ADIS16470
    • Motor Controllers
      • SparkMAX
      • SparkFlex
      • TalonFX
    • Absolute Encoders
  • Analytics and Debugging
    • FRC Web Components
    • Advantage Scope
  • Product Guides
    • Java API
    • PathPlanner
    • ❌Tuning PID with REV Hardware Client
    • ❌Drive Code
  • Legacy Documentation
Powered by GitBook
On this page
  • Device Configuration
  • Fields
  • Useful tips

Was this helpful?

Edit on GitHub
  1. Configuring YAGSL
  2. Configuration

Device Configuration

PreviousController Properties ConfigurationNextCode Setup

Last updated 4 months ago

Was this helpful?

Device Configuration

All devices in a swerve drive come down to a basic set of fields. The device configuration is used to store and create those devices during parsing with a 1:1 mapping to .

Fields

Name
Units
Required
Description

type

Y

The device type which is used for creation of the Swerve type.

id

Integer

Y

The ID of the device on the CANBus, or the pin ID on the roboRIO for certain devices.

canbus

String

N

The canbus to instantiate the device on. Only works on devices compatible with alternate CAN buses. When the type is sparkmax_brushed this defines the encoder attached to the motor which is required for drive motors, angle motors should also use them if there is no attached absolute encoder. The valid values in this case are greyhill_63r256, srx_mag_encoder, throughbore, throughbore_dataport, greyhill_63r256_dataport, srx_mag_encoder_dataport. DO NOT SET THIS IF THE ATTACHED ENCODER IS AN ABSOLUTE ENCODER

Useful tips

  1. Optimize your IMU if it isn't as accurate as you hope, NavX's have this nice guide

  2. Read the code! If you can't understand something all of the code is documented and easy to read.

DeviceJson
here
Encoder type
IMU type
Motor type