I received the same issue with the differential drive but I got the error saying drive train wasn’t updated enough so I thought switching to control the Victor SPX’S directly would fix it but I had the same issue but with no errors
I know but the error isn’t the issue the problem is that the robot physically shows the problem, if I turn the robot using tank drive it stops and goes even when I hold the joysticks in the same position
Yeah at first I thought maybe it was a gearbox issue but then I can see the motor controllers flashing orange(meaning that there is no power to the motors) and green(meaning that it’s giving power to the motors) whenever it gets choppy.
notmattlythgoe is definitely onto something – both RobotMap.driveTrain (type type edu.wpi…DifferentialDrive) and Robot.driveTrain (frc.robot.subsystems.DriveTrain) have access to the objects that communicate with your motor controllers. Likely, they are both calling the set() methods on your m_driveTrain… VictorSPX objects and thus “fighting”. I suspect it is related to motor safety code called from DifferentialDrive.
I suggest starting by removing public…DifferentialDrive driveTrain; (line 43) and driveTrain = new DifferentialDrive…(line 87) in OI. If you want to use DifferentialDrive, I would recommend putting all of it inside your frc.robot.subsystems.DriveTrain class instead.
I’ll try out timedrobot thank you, maybe that would fix my issue with the choppy driving, it felt like my problem was with the code not updating enough so that’s make sense why timed robot could fix it
TimedRobot and IterativeRobot are very very similar. IterativeRobot is deprecated this year. Basically IterativeRobot updates whenever a packet is received and TimedRobot defaults to updating every 20 ms.
Unless you have overruns in your console, either one should update at a high enough rate.
I’ll try that out too but originally I didn’t have a issue with my placement of Differential drive the problem occured when I switched from timed to.itterative. originally I thought the timedrobot was causing my commands not to run but really it was because I forgot to add the scheduler