GithubHelp home page GithubHelp logo

daltzctr / sysid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wpilibsuite/sysid

0.0 0.0 0.0 1.6 MB

System identification for robot mechanisms

License: Other

C++ 91.18% Python 0.54% CSS 8.28%

sysid's Introduction

SysId: System Identification for Robot Mechanisms

Build

This is the C++ version of frc-characterization. It uses the wpimath backend for generating feedforward and feedback gains.

Supported Vendor Hardware

This is a list of the vendors that are currently supported by SysId for 2023:

Vendors

  • CTRE: TalonSRX, TalonFX, VictorSPX, CANCoder, and Pigeon IMU
  • NavX Gyro (No integration tests)
  • Playing With Fusion Venom
  • REV: SparkMax Motor Controller

Hardware Supported by WPILib

  • ADIS16448 IMU
  • ADIS16470 IMU
  • ADXRS450 Gyro
  • Analog Gyro
  • Encoders plugged into the roboRIO
  • PWM Motor Controllers

Downloading and Running Development Versions of SysId (Analysis Only)

The SysId GitHub repository uses GitHub Actions to build and test each commit.

To download development version of SysId from the main branch (most stable):

  1. Click here.
  2. Select the run of your choosing (the top most run is the latest).
  3. Scroll down to the artifacts section, and select the appropriate build for your operating system.

To download development version of SysId from all branches:

  1. Click here.
  2. Select the run of your choosing (the top most run is the latest).
  3. Scroll down to artifacts section, and select the appropriate build for your operating system.

To run development versions of SysId

  1. Extract the files from the downloaded zip file.
  2. Extract the files from the zip file located in the root of the extracted folder.
  3. Open the folder named after your operating system (ex: Linux, Windows, macOS).
  4. Open the folder named for your architecture.
  5. Run the executable named sysid.

Downloading and Running Full Development Versions of SysId (Generation, Logging, Analysis)

Clone the SysId Github repository to get all the necessary code.

Go to the directory that the repository is cloned in and run ./gradlew run to start the executable.

Generating And Running SysId Robot Code

  1. Use the Generator Widget to create a config.json
  2. If you are characterizing a mechanism (Arm, Simple Motor, Elevator), deploy the project in sysid-projects/mechanism to your robot (./gradlew :sysid-projects:mechanism:deploy). For drivetrain charactarization (Drivetrains, Romi), deploy the project in sysid-projects/drive to your robot.
  3. Connect the logger to your robot and perform the required tests.

Building and Running SysId

SysId uses Gradle to build. To build debug and release versions of the main executable and run tests, run ./gradlew build. During development, you can use ./gradlew run to build and run the debug executable.

SysId also has integration tests, which involves launching a robot program with simulation physics, characterizing it and verifying the gains. These tests are not enabled by default; instead, you need to pass the -PwithIntegration flag into Gradle. Use ./gradlew runAnalysisIntegrationTests -PwithIntegration or ./gradlew runGenerationIntegrationTests -PwithIntegration to run just the analysis or project generation integration tests respectively.

There is also a robot project in sysid-projects/analysis-test that you can use to test out SysId. To launch the robot program, simply run ./gradlew :sysid-projects:analysis-test:simulateCpp.

Requirements

  • JDK 11
    • Note that the JRE is insufficient; the full JDK is required
    • On Ubuntu, run sudo apt install openjdk-11-jdk
    • On Windows, install the JDK 11 .msi from the link above
    • On macOS, install the JDK 11 .pkg from the link above
  • C++ compiler
    • On Linux, install GCC 7 or greater
    • On Windows, install Visual Studio Community 2019 and select the C++ programming language during installation (Gradle can't use the build tools for Visual Studio 2019)
    • On macOS, install the Xcode command-line build tools via xcode-select --install

Logging Projects

SysId comes with projects that interface with the telemetry manager to provide the necessary data for analysis. These projects are stored in the sysid-projects folder and take in a config.json file in the sysid-projects/deploy directory to setup the robot hardware for analysis.

There is a drivetrain project for drivetrain analysis and a mechanism project for simple-motor, elevator, and arm analyses.

Running the Projects

The executable generated from building is currently hardcoded to save to the proper project and these projects can be run normally from VSCode or the command line.

Time Plotting Script

There is a python script in the scripts directory that will plot sysid data with respect to time. This is mainly intended for developers in the case that a dataset breaks sysid.

In order to run it, pandas and matplotlib must be installed via pip.

Then run python3 scripts/time_plots.py "file path" to get the time plots for your desired datasets.

Matplotlib windows will appear containing the different plots.

sysid's People

Contributors

piphi5 avatar calcmogul avatar prateekma avatar oblarg avatar thadhouse avatar jlmcmchl avatar peterjohnson avatar austinshalit avatar katzuv avatar memtech3 avatar modelmat avatar ohowe1 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.