Currently the only convenient way to get swerve modules out of SwerveDrivetrain is by calling getModule(int) with an index. With no way to access module count internal to SwerveDrivetrain, there isn't a convenient way to iterate over the modules without null checking. A convenient solution is to have a getter function that returns the modules as a List<SwerveModule>.
Currently the only convenient way to get swerve modules out of
SwerveDrivetrain
is by callinggetModule(int)
with an index. With no way to access module count internal toSwerveDrivetrain
, there isn't a convenient way to iterate over the modules without null checking. A convenient solution is to have a getter function that returns the modules as aList<SwerveModule>
.