FRC Team 4478 Code

Hello all,
I am attaching my team’s practice code generated by Robot builder. There are two attached files; the C++ file generated by robot builder, and the Java file generated by robot builder. I would attach the Robot builder file and the wiring file, but Chief Delphi won’t allow me to. The robot that was modeled with the Robot builder has a two motor drivetrain, along with a pneumatic shifter, and a manipulator with a double actuated cylinder, a navigation subsystem with two encoders and a gyro.

  The pneumatic subsystem contains a compressor.  We have decided to use gamepads instead of joysticks under the Operator Interface, one for the driver and one for the manipulator, and this required creating our own gamepad class, as it is not provided in the wpilib. Under commands, we have included a generic drive with gamepad command for teleoperated mode and an autonomous command for autonomous mode. We have also decided to include two commands to operate the manipulator, Cylinder In and Cylinder Out.

We also modified the Iterative Robot class for Java, so that periodic loops can follow a timer instead of the driver station packets, like C++.

RobotBuilder can be found on firstforge and I assume on tomorrow.<br><br><a class='attachment' href='/uploads/default/original/3X/4/1/'></a> (101 KB)<br><a class='attachment' href='/uploads/default/original/3X/3/1/'></a> (254 KB)<br><br><br><a class='attachment' href='/uploads/default/original/3X/4/1/'></a> (101 KB)<br><a class='attachment' href='/uploads/default/original/3X/3/1/'></a> (254 KB)<br>

Your Java code looks very good, apart from some formatting problems (I assume from RobotBuilder). Was that all from RobotBuilder? If it is (especially your PID code), I might take a second look at it if it gives you that much functionality,

No, that was not all RobotBuilder. RobotBuilder essentially provides a shell into which you need to put the guts and we’re using it as a starting point for our coding. We’re primarily interested in the “Command Based” functionality - previously we’ve used long and ugly state machines for autonomous coding. Things like member variable names were edited to conform to the “m_” convention.

The PID code is ours and you’re welcome to use it.

I’m interested to learn what the formatting problems you mentioned are. Those are probably ours, not RobotBuilder.

I saw a few comments, brackets, and other structure elements that were off-tabbed. In Netbeans, Alt-Shift-F automatically formats code structure, it performs miracles.

Another note, the m_ convention is not actually part of the Java coding conventions, but if your intention is to make things consistent from WPIlibj and your code, that’s alright.

Thanks for the information! I’ll have to try that out to see if it fixes the formatting problems.