Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Command-Based robot + OI + joystick axis? (http://www.chiefdelphi.com/forums/showthread.php?t=153695)

trycatch 15-01-2017 00:07

Command-Based robot + OI + joystick axis?
 
Hey all. This is my first year trying to transfer over to Command Based, and I think I've got most of it figured out. I've got a few JoystickButtons with whenPressed commands in the OI, but I'm a bit fuzzy on how to handle the actual joystick x, y, and twist. Is there an on-pressed equivalent, or should I just get the x, y and twist every teleopPeriodic and add a new Drive() to the scheduler?

Thanks all!

WSiggs 15-01-2017 00:09

Re: Command-Based robot + OI + joystick axis?
 
Quote:

Originally Posted by trycatch (Post 1631389)
Hey all. This is my first year trying to transfer over to Command Based, and I think I've got most of it figured out. I've got a few JoystickButtons with whenPressed commands in the OI, but I'm a bit fuzzy on how to handle the actual joystick x, y, and twist. Is there an on-pressed equivalent, or should I just get the x, y and twist every teleopPeriodic and add a new Drive() to the scheduler?

Thanks all!

You shouldn't need to change anything in teleopPeriodic, the easiest way is to just set a default command for your drive subsystem, and then in the execute method of the command set the drive motors to the value from the joysticks.


All times are GMT -5. The time now is 15:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi