Package robot.subsystems
Class OrchestraSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
robot.subsystems.OrchestraSubsystem
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class OrchestraSubsystem
extends edu.wpi.first.wpilibj2.command.SubsystemBase
Orchestra™
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.wpilibj2.command.Commandc_loadAndPlaySong(String name, int tracks, CustomTalonFX... motors) Loads a song and then returns a command to play it.static voidloadSong(String name, int tracks, CustomTalonFX... motors) Loads a song to be played later withplaySong(String).static booleanPlay a song that was already loaded withloadSong(String, int, CustomTalonFX...).static booleanstopAll()Stop all songs.static booleanStop a song.Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, periodic, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
PATH
- See Also:
-
songName
-
playing
public boolean playing
-
-
Method Details
-
loadSong
Loads a song to be played later withplaySong(String).Files for the song should be located at
deploy/chirp/<name>_<track>.chrp- Parameters:
name- The name of the song to load.tracks- The number of tracks the song has.motors- The motors that will be used to play the song. There should be at least as many motors as there are tracks. Motors will be distributed as evenly as possible between the tracks, filling all tracks first, then going back to add multiple motors to the same track (you can use nulls to skip over tracks when assigning motors).
-
playSong
Play a song that was already loaded withloadSong(String, int, CustomTalonFX...).- Parameters:
name- The name of the song to play.- Returns:
- Whether the song was successfully played.
-
stopSong
Stop a song.- Parameters:
name- The name of the song to stop.- Returns:
- Whether the song was successfully stopped.
-
stopAll
public static boolean stopAll()Stop all songs.- Returns:
- Whether all songs were successfully stopped.
-
c_loadAndPlaySong
public static edu.wpi.first.wpilibj2.command.Command c_loadAndPlaySong(String name, int tracks, CustomTalonFX... motors) Loads a song and then returns a command to play it. SeeloadSong(String, int, CustomTalonFX...).- Returns:
- A
Commandto play the song.
-