Flash3388 / FlashLib

A robotics development framework
BSD 3-Clause "New" or "Revised" License
10 stars 0 forks source link

Suggestion: Annotation Processing for Components #91

Open tomtzook opened 1 year ago

tomtzook commented 1 year ago

Add annotations for annotation processing to be used for easily creating controllers and sensors.

For example:

class DriveSystem extends Subsystem {
    @InjectMotorController(type="PwmTalon", channel=2)
    private SpeedController controller;

    @InjectGyro(type="AnalogGyro", channel=0)
    private Gyro gyroscope;
}

The values for those will then be created and injected with annotation processing.

Of course this would require an extendible processor to support new types with different arguments and each to be incased in an interface.

Can also use for simulation as such:

@Simulated(type = TankDriveSim.class, params=...)
class DriveSystem extends Subsystem {

}

Where the user specifies the type of the system to simulate and params about the system characteristics and the processor will generate simulation code for it.