I multiplied it by .2 because of my limited driving space, but occasionally I’ll see my Victor SPX’S flash oarnge even when the joysticks are pushed down all the way
Just a note: WPILib already squares the drive inputs by default; doing this is redundant if you are using the RobotDrive function. It appears the OP is not using this, but just a note for anyone else.
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
Honestly the error where the differential drive isn’t updated enough is almost meaningless. There are plenty of robots and times were the error would appear to no issues when driving the robot.
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
I would suggest maybe creating a new CommandBased project from the template and starting over. It really sounds like you’re trying to built it up from scratch instead.