Drive Command not running!

Also, are you seeing your Hello? Hello? Hello? statement when you enable the bot? Try moving it to the execute() method instead so you dont miss it.

Yeah, we tried the hello hello thing to see if the command even starts up at all. We never saw it, shouldn’t it have said it as it initialized? And okay, we’ll move it to execute()

It should yes, but could be lost in other messages. Do you still get the DifferentialDrive… Output not updated often enough error?

yeah… wpi_talonsrx still doesn’t seem to import, although it obviously exists in the code somewhere

we’ll try that rn

It should be

import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;

yes, we are still getting the output not updated enough error. It must obviously be that the command file isn’t running well enough

Or it isn’t running at all, I assume you’re not seeing the hello message.
Oh here’s a thought, do you have Scheduler.getInstance().run(); in the teleopPerodic() method in Robot.java?

No we don’t, we thought that command was supposed to just auto-run upon initialization? All we have is:

public static DriveSubsystem drive = new DriveSubsystem();

SendableChooser m_chooser = new SendableChooser<>();

and in the robotInit:
m_chooser.setDefaultOption(“Drive”, new DriveCommand());

You do have a teleopPeriodic() method though, right?

IT WORKED!!! Scheduler.getInstance().run() in the teleopPeriodic did the trick! We were thinking all along that command just runs naturally and doesn’t have to be started in a teleop. Since we also drive in autonomous, should we just have “Scheduler.getInstance().run()” in autonomousperiodic too?

Yup, sure do!

Thank you SO much. It was great help, we were stuck on this for hours today but we are so grateful that you and all the others could support us in figuring this out. Thank you so much.

The scheduler takes care of running all the commands automatically like you said, but the scheduler itself still has to be run!

Any time!

Ahhhhhhhhh all that for a tiny error! I should’ve sent you guys the Robot.java file earlier haha, glad it’s fixed now though, we have most of the robot code finished, all we need to do is just split the classes into subclasses and commands now

Happy to help! And good luck!

Another thought, that could have been why you couldn’t find the scheduler in shuffleboard, take another look, it’s a great tool for finding out when a command is running.

You will continue to have DifferentialDrive errors if you continue with the same driving methods you posted earlier.

In your turn90 degree methods for example the while() loops will overrun the 20 ms scheduler loops (more than likely) and give you errors.

If you want to have something that continually turns until you hit the angle, check out something basic like our TurnWithoutPID command. You’ll have to tweak that code to make it work, we don’t actually use it in our code this year but it should show you some basics on how to incorporate commands like that.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.