Motor Timeout Error

I think I finally got my code to work but now I get an error on the dashboard that sais that motor timeout and that the motor was not refreshed enough.

I am using command based, and following a tutorial, I did not write any refreshing code so that might be it, how do I do it??


#include <Commands/Command.h>
#include <Commands/Scheduler.h>
#include <LiveWindow/LiveWindow.h>
#include <SmartDashboard/SendableChooser.h>
#include <SmartDashboard/SmartDashboard.h>
#include <TimedRobot.h>
#include <RobotDrive.h>

#include “Commands/ExampleCommand.h”
#include “Commands/MyAutoCommand.h”
#include <DriveWithJoystick.h>

class Robot : public frc::TimedRobot {
void RobotInit() override {
m_chooser.AddDefault(“Default Auto”, &m_defaultAuto);
m_chooser.AddObject(“My Auto”, &m_myAuto);
frc::SmartDashboard::PutData(“Auto Modes”, &m_chooser);

 * This function is called once each time the robot enters Disabled
 * mode.
 * You can use it to reset any subsystem information you want to clear
 * when
 * the robot is disabled.
void DisabledInit() override {}

void DisabledPeriodic() override {

 * This autonomous (along with the chooser code above) shows how to
 * select
 * between different autonomous modes using the dashboard. The sendable
 * chooser code works with the Java SmartDashboard. If you prefer the
 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
 * GetString code to get the auto name from the text box below the Gyro.
 * You can add additional auto modes by adding additional commands to
 * the
 * chooser code above (like the commented example) or additional
 * comparisons
 * to the if-else structure below with additional strings & commands.
void AutonomousInit() override {
	std::string autoSelected = frc::SmartDashboard::GetString(
			"Auto Selector", "Default");
	if (autoSelected == "My Auto") {
		m_autonomousCommand = &m_myAuto;
	} else {
		m_autonomousCommand = &m_defaultAuto;

	m_autonomousCommand = m_chooser.GetSelected();

	if (m_autonomousCommand != nullptr) {

void AutonomousPeriodic() override {

void TeleopInit() override {
	// This makes sure that the autonomous stops running when
	// teleop starts running. If you want the autonomous to
	// continue until interrupted by another command, remove
	// this line or comment it out.
	if (m_autonomousCommand != nullptr) {
		m_autonomousCommand = nullptr;


void TeleopPeriodic() override { frc::Scheduler::GetInstance()-&gt;Run(); }

void TestPeriodic() override {}

// Have it null by default so that if testing teleop it
// doesn’t have undefined behavior and potentially crash.
frc::Command* m_autonomousCommand = nullptr;
ExampleCommand m_defaultAuto;
MyAutoCommand m_myAuto;
frc::SendableChooser<frc::Command*> m_chooser;



#ifndef Chassis_H
#define Chassis_H

#include <Wpilib.h>
#include <Commands/Subsystem.h>

class Chassis : public Subsystem {
RobotDrive* drive;

void InitDefaultCommand();

void ArcadeDrive(Joystick* stick);


#endif // Chassis_H


#include “Chassis.h”
#include “…/RobotMap.h”
#include <Wpilib.h>

Chassis::Chassis() : Subsystem(“ExampleSubsystem”)

drive = new RobotDrive(1, 2);


void Chassis::InitDefaultCommand() {
// Set the default command for a subsystem here.
//SetDefaultCommand(new DriveWithJoystick());

void Chassis::ArcadeDrive(Joystick* stick)




#ifndef DriveWithJoystick_H
#define DriveWithJoystick_H

#include “…/CommandBase.h”

class DriveWithJoystick : public CommandBase {
void Initialize();
void Execute();
bool IsFinished();
void End();
void Interrupted();

#endif // DriveWithJoystick_H


#include “DriveWithJoystick.h”
#include <Wpilib.h>

DriveWithJoystick::DriveWithJoystick() {
// Use Requirehere to declare subsystem dependencies


// Called just before this Command runs the first time
void DriveWithJoystick::Initialize() {


// Called repeatedly when this Command is scheduled to run
void DriveWithJoystick::Execute() {



// Make this return true when this Command no longer needs to run execute()
bool DriveWithJoystick::IsFinished() {
return false;

// Called once after isFinished returns true
void DriveWithJoystick::End() {


// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void DriveWithJoystick::Interrupted() {


Should I include anything else? I really don’t know what to do…

Try posting your code te Pastebin or Github so you don’t have emojis floating around and we get formatting and stuff.

The motor watchdog makes sure that set() is called every loop. If you call set() once in an initialization of a command and then never again, it will stop the motors because it thinks your code is uncontrolled.

I’m not a C++ person, but in Java you need to 1) Create a Command object 2) call start() on this command object. It looks like you create an instance of DriveWithJoystick and then don’t do anything with this object. Try calling DriveWithJoystick(1).start() or similar (again, don’t know C++ well.)