![]() |
FRC Team 4478 Code
2 Attachment(s)
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 http://wpilib.screestepslive.com tomorrow. |
Re: FRC Team 4478 Code
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,
|
Re: FRC Team 4478 Code
Quote:
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. |
Re: FRC Team 4478 Code
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. |
Re: FRC Team 4478 Code
Thanks for the information! I'll have to try that out to see if it fixes the formatting problems.
|
| All times are GMT -5. The time now is 02:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi