Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simulation and unit tests #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SamCarlberg
Copy link

Remove direct hardware access from the subsystem and go through an IO layer. This is necessary so that we can simulate the robot's mechanisms on desktop and still use the same control configurations and setups (joystick inputs, path following, and commands).

Do the same for swerve modules - MAXSwerveModule hardware implementation becomes MAXSwerveModuleIO, with a corresponding IO object for use in simulation

Add a simple simulation framework to coordinate battery voltage droop from multiple mechanisms

Add some simple tests to demonstrate JUnit and test setup

See the documentation here on running simulation: https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/index.html


I've attached three files to get started with the simulation GUI. Save these to your project folder before running simulation (for example, if you've cloned the repository to C:\Users\you\Documents\2023-swerve\, download these files directly into that folder). These are set up to show a simple field and robot UI, controllable with a keyboard. Use WASD to move and QE to rotate the robot. If the robot leaves the field, starting autonomous mode will reset its position to 0, 0 at the bottom left corner of the field.

simgui-ds.json
simgui-window.json
simgui.json

image

Remove direct hardware access from the subsystem and go through an IO layer
Do the same for swerve modules - MAXSwerveModule hardware implementation becomes MAXSwerveModuleIO
Add a simple simulation framework to coordinate battery voltage droop from multiple mechanisms
Add some simple tests to demonstrate JUnit and test setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant