def neutralOutput(self) -> None:
if RobotBase.isReal():
self.motor.neutralOutput()
else:
self.setSpeed(0)
Function calls in python are relatively expensive compared to other code execution, so prefer to lift them out so that they're executed less frequently (or only once if their output isn't going to change, such as the case here):
For example in Falcon:
Function calls in python are relatively expensive compared to other code execution, so prefer to lift them out so that they're executed less frequently (or only once if their output isn't going to change, such as the case here):
Alternatively, use completely different classes: