

Your experience
Your comfort level
Your computer









GC
No Pointers
Easy extension
Performance?
Code runs on the RIO
Network connection talks to Driverstation software
User input is translated by drivers on Driverstation, pushed as basic input through network
Output is absolutely stopped by internal libraries when disabled
Robot could run without you - just needs a gamemode signal
There will always be a loop; an instruction will run over-and-over
while ( isTeleoperatedMode() ) {
drivebase.drive( joystick.getLeftStickValue(), joystick.getRightStickValue() )
}Read as english...
While it is teleoperated mode, drive the left motors at the same speed as given by left stick value, and right motors at the same speed given by right stick value.
Essentially, find the appropriate way to change output according to input
You need to check the input each time!
eg.
You don't want to be writing the exact same kind of code for every action and behaviour
You want your code to be readable
You want control over structure and behaviour
You want something open source and consistently maintained
You are cool
if (CONTROL_STYLE.equals("arcade")) {
joystick1.addAxisBind(
drivetrain.getArcade(joystick1.getLeftDistanceFromMiddle(),
joystick1.getRightX())
);
} else if (CONTROL_STYLE.equals("tank")) {
joystick1.addAxisBind(
drivetrain.getTank(joystick1.getLeftDistanceFromMiddle(),
joystick1.getRightDistanceFromMiddle())
);
}
joystick1.addWhenPressed(XboxController.START,
new SetSpikeRelay(photonCannon, SpikeRelay.Direction.FORWARDS));
joystick1.addWhenPressed(XboxController.BACK,
new SetSpikeRelay(photonCannon, SpikeRelay.Direction.OFF));
joystick2.addWhenPressed(XboxController.A,
new EnableModule(winchBack));
joystick2.addWhenPressed(XboxController.A,
new SetDualActionSolenoid(winchRelease, DualActionSolenoid.Direction.RIGHT));
joystick2.addWhenPressed(XboxController.B,
new DisableModule(winchBack));
joystick2.addWhenPressed(XboxController.B,
new SetOutput(winchMotor, 0));
joystick2.addWhenPressed(XboxController.X,
new ReverseDualActionSolenoid(loaderPiston));
joystick2.addWhenPressed(XboxController.BACK,
new EnableModule(loaderController));
joystick2.addWhenPressed(XboxController.BACK,
new SetOutput(loaderController, customSetpoint));
joystick2.addWhenPressed(XboxController.START,
new SetOutput(customSetpoint, loaderPosition));
joystick2.addWhenPressed(XboxController.START,
new SetOutput(loaderController, loaderPosition));
joystick2.addWhenPressed(XboxController.START,
new EnableModule(loaderController));Taken straight from 2014 competition code
Command groups are a Command that encompasses multiple commands strung together. It runs commands sequentially or concurrently in groups, in the order of how they are added.
public final class ShootAndRun extends CommandGroup {
public ShootAndRun() {
addSequential(new ChangeRPM(3750));
addSequential(new Shoot());
addSequential(new Shoot());
addSequential(new Shoot());
addConcurrent(new DriveForwards(1520));
addConcurrent(new ChangeRPM(3200));
addConcurrent(new RunGroundPickup());
addSequential(new Shoot());
addSequential(new Shoot());
addSequential(new Shoot());
addSequential(new Shoot());
}
}Commands used in autonomous and teleoperated
Default commands included
Interacts well with system (internal and external)
Virtually no overhead

Text file with script held on RIO
Edit on-the-fly, push changes by FTP
Custom variables, actions, commands, extensions
Interact at a low level with the code
def concat(x, i)
def _concat(j, w, e)
if(e > 0)
return _concat(j + w, w, e - 1)
else
return j
end
end
return _concat("",x,i)
end
print(concat("Hello World", 3))Recursion, classes, methods, math, variables, and more
Developed by 973 for 2011 (they won worlds that year)
Not actively maintained
Lua syntax and feature set
while num < 50 do
num = num + 1
end
if num > 40 then
print('over 40')
elseif s ~= 'walternate' then
io.write('not over 40\n')From someone who spent hours doing this...
You should start in week 1-2
All features should be functional by week 4
Learn the basics ahead of time - get familiar with the workflow
Install things before; that is a stupid thing to stall you
Scouting
Android, IOS, Desktop, etc.
Team website
Libraries, tools, etc.
Take the opportunity to learn something.
Find something to do, and learn from it.
Should never be over 5 people
Better to have 100% dedicated members
Leadership roles
Programming team leader
Programming mentor
Member roles
Organization (version control, etc.)
Documentation
Code Review (bug fixes, etc.)
Depends on your time commitment
Depends on your experience
Version control?
Formal or casual process?
Can be adjusted according to needs
Team took on a really ambitious programming goal?
Robot moving
Robot driving
Robot functioning modules (shooting, etc.)
Robot using sensors
Robot operating autonomously

joelg236.github.io



/joelg236