ligerbots / Steamworks2017Robot

LigerBots robot code for FIRST Robotics Competition Steamworks
MIT License
2 stars 1 forks source link

DriveTrain default command circular dependency #7

Closed xeniarose closed 7 years ago

xeniarose commented 7 years ago

In Robot.java, DriveTrain is constructed, and then DriveJoystickCommand is constructed. It needs to be in that order because DriveJoystickCommand requires DriveTrain in the constructor. But I'm not sure whether setting the default command actually works, since it's null at the time of construction. Ostensibly, WPILib knows about this problem and that's why they have the initDefaultCommand() method (which is called later, maybe. It's 11pm and I'm not willing to browse the WPILib source right now 😴) instead of simply making teams do it in the constructor. This will need to be tested though.

xeniarose commented 7 years ago

According to the logs, this isn't an issue