Changes between Version 5 and Version 6 of Command Based Robot Notes
- Timestamp:
- Jan 15, 2015, 8:11:22 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Command Based Robot Notes
v5 v6 7 7 - ''Default Commands'' 8 8 * Continuously executing until Interrupt 9 10 {{{setDefaultCommand(new ExampleGroup());}}} 11 9 12 - ''Relation To Robot'' 10 * Subsystems can be compared to mechanisms that use the same overall resources 11 * Realize that two actions cannot occur at the same time, that require the same subsystem 13 * Subsystems can be compared to mechanisms that use the 14 same overall resources 15 * Realize that two actions cannot occur at the same time, that require the same subsystem 16 12 17 - ''Dependencies'' 13 * Dependencies are created by the requires(Subsystem subsystem)18 * Dependencies are created by 14 19 * These prevent two different commands from utilizing the same resources on the robot 20 21 {{{requires(Robot.exampleSubsystem);}}} 15 22 16 23 '''Commands''' … … 18 25 * Called to stop a command from running 19 26 * Specifically when robot is disabled or a dependency overlaps 27 20 28 - ''Connection With Buttons'' 21 29 * Commands can be easily mapped to buttons through the OI class … … 24 32 - ''Input Devices'' 25 33 * Input devices are mapped through joystick and button objects 34 35 {{{Joystick js0 = new Joystick(0);}}} 36 37 {{{Button btn00 = new JoystickButton(js0, 0);}}} 26 38 - ''Button Actions'' 27 39 * Commands can be mapped to buttons or triggers in the OI class 40 41 {{{btn00.whileHeld(new Command());}}} 28 42 29 43 '''Robot Map''' … … 31 45 * This class centralizes port numbers and connection numbers for robot-wide use 32 46 47 {{{public static int defaultMotor = 2;}}} 48 33 49 '''Command Groups''' 34 50 - ''About'' 35 51 * Command Groups are used for command sequencing and parallelizazation 36 52 * Basically running things in a specific order or at the same time 37 * think about automated actions 53 * Think about automated actions 54 * Commands will add in order of methods to add them 55 38 56 - ''Sequential'' 39 57 * TODO(testing) 58 59 {{{addSequential(new Command1());}}} 40 60 - ''Parallel'' 41 61 * TODO(testing) 62 63 {{{addParallel(new Command1());}}}