Open Shalmezad opened 4 years ago
Alright, that's probably as far as I'm going to get in the code review.
Keep in mind, that in the process of handling these that you may break the code, so would limit what you do at/during competition. The only ones I'd advise doing as soon as possible are:
initializeMotors()
calls. These should be handled by the subsystems in the constructor, not in a command's initialize()
. The commands should assume the subsystem has gone through it's initialization (setting motors to invert/follow), and should only have to do command specific initialization (ie: change to velocity mode). This will cause you problems if you forget to call it for a command. Also, @AshwinS27: DO NOT ATTEMPT TO DO ALL THESE AT ONCE BY YOURSELF.
There's a lot there (136 based on a quick count). You will burn out if you do. Would strongly recommend:
One last thing: Once done with the fixes, put an issue in my name to do another code review so I can go over the fixes. There's a good chance there are things I missed in this review that will be easier to catch once the codebase is cleaned up.
Did a quick once over. Everything's in branch code_review_2020_03_05. You'll want to install the TODO Tree extension by gruntfuggly if you haven't already as it'll help you find the
FIXME
's faster.Here are the major items I found. I would strongly encourage you to share these with the rest of the programming team to help avoid them cropping up again.
ControlPanel
orTurret
) in the SmartDashboard key. This makes it significantly easier to find (both in the code and in the shuffleboard. If you haven't used it yet, shuffle board has a search feature for the network table to find keys) which will save you time in the future when you need to debug.periodic()
method. Otherwise, the values won't show up on the smart dashboard unless the specific method/command is called. Again, will save you time in the future when you need to debug.System.out.println
. Yes, there's a RIOLog that you can write to. Don't. It takes bandwidth, space on the driverstation, and makes it harder to find important messages that the CSA uses to diagnose your robot in the case of issues. Use the SmartDashboard.isFinished()
as justreturn true()
, it should be anInstantCommand
!
), and hopefully they're also teaching that you can just doreturn x > 10
rather thanif(x>10){return true;}else{return false;}
There's still things I need to check, so leaving this issue as
IN PROGRESS
for now. Once I'm done, will remove it from the title and assign accordingly.