161 std::shared_ptr<AsyncPositionController<double, double>>
build();
164 std::shared_ptr<Logger> logger;
166 bool hasMotors{
false};
167 std::shared_ptr<AbstractMotor> motor;
169 bool sensorsSetByUser{
false};
170 std::shared_ptr<RotarySensor> sensor;
172 bool hasGains{
false};
173 IterativePosPIDController::Gains gains;
174 std::unique_ptr<Filter> derivativeFilter = std::make_unique<PassthroughFilter>();
176 bool gearsetSetByUser{
false};
179 bool maxVelSetByUser{
false};
180 double maxVelocity{600};
182 TimeUtilFactory timeUtilFactory = TimeUtilFactory();
185 bool isParentedToCurrentTask{
true};
187 std::shared_ptr<AsyncPosIntegratedController> buildAPIC();
188 std::shared_ptr<AsyncPosPIDController> buildAPPC();
std::shared_ptr< AsyncPositionController< double, double > > build()
Builds the AsyncPositionController.
AsyncPosControllerBuilder & withSensor(const std::shared_ptr< RotarySensor > &isensor)
Sets the sensor.
AsyncPosControllerBuilder & withGains(const IterativePosPIDController::Gains &igains)
Sets the controller gains, causing the builder to generate an AsyncPosPIDController.
AsyncPosControllerBuilder & withDerivativeFilter(std::unique_ptr< Filter > iderivativeFilter)
Sets the derivative filter which filters the derivative term before it is scaled by kD.
AsyncPosControllerBuilder & withGearset(const AbstractMotor::GearsetRatioPair &igearset)
Sets the gearset.
AsyncPosControllerBuilder & withMotor(const std::shared_ptr< AbstractMotor > &imotor)
Sets the motor.
AsyncPosControllerBuilder & notParentedToCurrentTask()
Prevents parenting the internal tasks started by this builder to the current task,...
AsyncPosControllerBuilder & withMotor(const MotorGroup &imotor)
Sets the motor.
AsyncPosControllerBuilder & withSensor(const ADIEncoder &isensor)
Sets the sensor.
AsyncPosControllerBuilder(const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
A builder that creates async position controllers.
AsyncPosControllerBuilder & withLogger(const std::shared_ptr< Logger > &ilogger)
Sets the logger.
AsyncPosControllerBuilder & withSensor(const IntegratedEncoder &isensor)
Sets the sensor.
AsyncPosControllerBuilder & withMaxVelocity(double imaxVelocity)
Sets the maximum velocity.
AsyncPosControllerBuilder & parentedToCurrentTask()
Parents the internal tasks started by this builder to the current task, meaning they will be deleted ...
AsyncPosControllerBuilder & withTimeUtilFactory(const TimeUtilFactory &itimeUtilFactory)
Sets the TimeUtilFactory used when building the controller.
AsyncPosControllerBuilder & withMotor(const Motor &imotor)
Sets the motor.
static std::shared_ptr< Logger > getDefaultLogger()
A simple structure representing the full ratio between motor and wheel.