This repository contains various examples of different frc simulation systems, mainly to explore possible uses for each one.
CTRE Simulations are useful for verifying logic before programmers are given access to a physical robot, as well as for simulating physics. However, because of the boilerplate classes and code (ex. SimCollection) and its lack of compatibility with existing methods of controlling motors (ex. MotionMagic, built-in PID that does not use the PIDController class), I believe there is not a strong reason to integrate CTRE Simulations with a codebase besides for the reasons mentioned above. A good use case for CTRE simulations include anything that may be logic heavy, including a swerve drivebase.
Please see the following documentation which was referenced in the making of this simulation:
- To run, open the command palette (Ctrl+Shift+P) and select WPILib: Simulate Robot Code.
- Select Sim GUI
- Click Teleoperated in the Robot State window (top left corner)
- Use the WS keys to move the arm forwards and backwards, and view simulated encoder values under NetworkTables > SmartDashboard
A majority of this code was found on the CTRE Github.
- To run, open the command palette (Ctrl+Shift+P) and select WPILib: Simulate Robot Code.
- Select Sim GUI
- Click Teleoperated in the Robot State window (top left corner)
- Use WASD to control the robot on the field, or view values under NetworkTables > SmartDashboard