Hello all!
As the title implies, a project I’ve been working on has had some immediate success in most areas, although there is one major bug that has stumped me; my default drive command.
First, just to reiterate, I am using command-based, and have previously used Python, so the Gradle project is still relatively new to me. I have looked at several examples in Kotlin and Java however, and I thought I was doing it correctly. My code in my subsystem looks like this:
init {
defaultCommand = DriveCommand()
}
If this is not this simple, I would certainly not be surprised. My command looks like this:
package frc.team2539.robot.commands.drivetrain
import frc.team2539.robot.subsystems.DriveTrain
import frc.team2539.robot.Controls
import frc.team2539.robot.cougartools.CougarCommand
class DriveCommand : CougarCommand() {
init {
addRequirements(DriveTrain)
}
override fun initialize() {
DriveTrain.stop()
}
override fun execute() {
print("Driving")
DriveTrain.move(
y = Controls.driverController.getRawAxis(1),
rotate = Controls.driverController.getRawAxis(3)
)
}
override fun end(interrupted: Boolean) {
DriveTrain.stop()
}
}
Please note that it appears that only the default commands are not functioning properly. Other commands I run off of buttons work. Also, due to the current health crisis, I have very limited access to my buildsite, and when I am there, the window of opportunity is rather small.
Again, any insights onto why this would not be executing this default command would be great. My Robot.kt and Main.kt can be found at my github, here.
Thanks!