|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Re: How to Program Mecanum
Quote:
I see you have created a subsystem and commands for pneumatics, and Scheduler is being run in telopPeriodic so lots looks right there. You have buttons to schedule your commands to extend and retract, so that looks good. But you took a shortcut and went away from subsystem/command for your drive train. I would reintroduce the old mecanum subsystem you used to have and move the motors and the mecanumDrive function you currently have on Robot to that subsystem. I would set the defaultCommand (as in the old version) to DriveTele-- this will automatically schedule DriveTele at startup. Then in execute() of DriveTele, you can make your call to Robot.mecanum.mecanumDrive() as you are currently doing in teleopPeriodic(). This will work better long term than the shortcut. Flow *should* be
You have taken a shortcut for your mecanumDrive call and gotten rid of steps 1, 3,4,5 and instead hardcoded what should be in DriveTele.execute and put it just before the last step to repeat. It's better for Scheduler to schedule a default DriveTele command and manage calls to execute than for you to directly call mecanumDrive() on Robot without any command or subsystem. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|