170 std::shared_ptr<AsyncVelocityController<double, double>>
build();
173 std::shared_ptr<Logger> logger;
175 bool hasMotors{
false};
176 std::shared_ptr<AbstractMotor> motor;
178 bool sensorsSetByUser{
false};
179 std::shared_ptr<RotarySensor> sensor;
181 bool hasGains{
false};
182 IterativeVelPIDController::Gains gains;
184 bool hasVelMath{
false};
185 std::unique_ptr<VelMath> velMath;
187 std::unique_ptr<Filter> derivativeFilter = std::make_unique<PassthroughFilter>();
189 bool gearsetSetByUser{
false};
192 bool maxVelSetByUser{
false};
193 double maxVelocity{600};
195 TimeUtilFactory timeUtilFactory = TimeUtilFactory();
198 bool isParentedToCurrentTask{
true};
200 std::shared_ptr<AsyncVelIntegratedController> buildAVIC();
201 std::shared_ptr<AsyncVelPIDController> buildAVPC();
AsyncVelControllerBuilder & withGearset(const AbstractMotor::GearsetRatioPair &igearset)
Sets the gearset.
AsyncVelControllerBuilder(const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
A builder that creates async velocity controllers.
std::shared_ptr< AsyncVelocityController< double, double > > build()
Builds the AsyncVelocityController.
AsyncVelControllerBuilder & withLogger(const std::shared_ptr< Logger > &ilogger)
Sets the logger.
AsyncVelControllerBuilder & withSensor(const IntegratedEncoder &isensor)
Sets the sensor.
AsyncVelControllerBuilder & notParentedToCurrentTask()
Prevents parenting the internal tasks started by this builder to the current task,...
AsyncVelControllerBuilder & withTimeUtilFactory(const TimeUtilFactory &itimeUtilFactory)
Sets the TimeUtilFactory used when building the controller.
AsyncVelControllerBuilder & withSensor(const std::shared_ptr< RotarySensor > &isensor)
Sets the sensor.
AsyncVelControllerBuilder & withSensor(const ADIEncoder &isensor)
Sets the sensor.
AsyncVelControllerBuilder & withMotor(const Motor &imotor)
Sets the motor.
AsyncVelControllerBuilder & withMaxVelocity(double imaxVelocity)
Sets the maximum velocity.
AsyncVelControllerBuilder & withMotor(const MotorGroup &imotor)
Sets the motor.
AsyncVelControllerBuilder & withVelMath(std::unique_ptr< VelMath > ivelMath)
Sets the VelMath which calculates and filters velocity.
AsyncVelControllerBuilder & withMotor(const std::shared_ptr< AbstractMotor > &imotor)
Sets the motor.
AsyncVelControllerBuilder & withDerivativeFilter(std::unique_ptr< Filter > iderivativeFilter)
Sets the derivative filter which filters the derivative term before it is scaled by kD.
AsyncVelControllerBuilder & withGains(const IterativeVelPIDController::Gains &igains)
Sets the controller gains, causing the builder to generate an AsyncVelPIDController.
AsyncVelControllerBuilder & parentedToCurrentTask()
Parents the internal tasks started by this builder to the current task, meaning they will be deleted ...
static std::shared_ptr< Logger > getDefaultLogger()
A simple structure representing the full ratio between motor and wheel.