Hi all, just wanted to open a thread for general discussion on the new CTRE simulation support.
I want to be able to teach my students how to implement the new Talon’s simulation support easily.
I will put here my understanding of it here and hopefully, we (I) could understand how to integrate it into the java/c++ command base framework while supporting real code execution when the time comes.
New release info:
The example that I will analyze here (motion magic)
My understanding - points:
SimProfileclass, all motor’s profiles will extend this class which includes
method (should be abstract prob) that will update the
SimCollectionabout the motor’s current state based on specific physic’s profile implementation
Creating a class that represents the specific motor physic’s profile which extends the
SimProfileclass for each motor (unless they are in follower more) in each system in our robot (different physics for each system so different profile)
PhysicsSimclass, manager class, creates and holds all of our motors profiles, will be updated (run) in
PhysicsSim: pushing talons so
PhysicsSimwill create and hold the appropriate profile in
PhysicsSimto update all active profiles
Physics dive in: (I will add a dive in on how to tweak the physics params if this thread will be active)
From my understanding, the main changes are:
TalonSRXSimCollection- through this collection teams will update the motors about their current state
- Phoenix Tuner simulation support which includes Plotter, Self Test Snapshot, Control, and Configs
- Support for simulated device-to-device features, such as follower mode and remote sensors/limit-switches
- Integration with WPILib’s simulation GUI when using WPI_* classes
So the provided example shows a way to update the
TalonSRXSimCollection, which is all we need to run a close loop control in simulation mode (?)
@ozrien Any input will be more than welcome