|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <asyncVelControllerBuilder.hpp>
Public Member Functions | |
| AsyncVelControllerBuilder (const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger()) | |
| A builder that creates async velocity controllers. | |
| AsyncVelControllerBuilder & | withMotor (const Motor &imotor) |
| Sets the motor. | |
| AsyncVelControllerBuilder & | withMotor (const MotorGroup &imotor) |
| Sets the motor. | |
| AsyncVelControllerBuilder & | withMotor (const std::shared_ptr< AbstractMotor > &imotor) |
| Sets the motor. | |
| AsyncVelControllerBuilder & | withSensor (const ADIEncoder &isensor) |
| Sets the sensor. | |
| AsyncVelControllerBuilder & | withSensor (const IntegratedEncoder &isensor) |
| Sets the sensor. | |
| AsyncVelControllerBuilder & | withSensor (const std::shared_ptr< RotarySensor > &isensor) |
| Sets the sensor. | |
| AsyncVelControllerBuilder & | withGains (const IterativeVelPIDController::Gains &igains) |
| Sets the controller gains, causing the builder to generate an AsyncVelPIDController. | |
| AsyncVelControllerBuilder & | withVelMath (std::unique_ptr< VelMath > ivelMath) |
| Sets the VelMath which calculates and filters velocity. | |
| AsyncVelControllerBuilder & | withDerivativeFilter (std::unique_ptr< Filter > iderivativeFilter) |
| Sets the derivative filter which filters the derivative term before it is scaled by kD. | |
| AsyncVelControllerBuilder & | withGearset (const AbstractMotor::GearsetRatioPair &igearset) |
| Sets the gearset. | |
| AsyncVelControllerBuilder & | withMaxVelocity (double imaxVelocity) |
| Sets the maximum velocity. | |
| AsyncVelControllerBuilder & | withTimeUtilFactory (const TimeUtilFactory &itimeUtilFactory) |
| Sets the TimeUtilFactory used when building the controller. | |
| AsyncVelControllerBuilder & | withLogger (const std::shared_ptr< Logger > &ilogger) |
| Sets the logger. | |
| AsyncVelControllerBuilder & | parentedToCurrentTask () |
| Parents the internal tasks started by this builder to the current task, meaning they will be deleted once the current task is deleted. | |
| AsyncVelControllerBuilder & | notParentedToCurrentTask () |
| Prevents parenting the internal tasks started by this builder to the current task, meaning they will not be deleted once the current task is deleted. | |
| std::shared_ptr< AsyncVelocityController< double, double > > | build () |
| Builds the AsyncVelocityController. | |
Definition at line 19 of file asyncVelControllerBuilder.hpp.
|
explicit |
A builder that creates async velocity controllers.
Use this to create an AsyncVelIntegratedController or an AsyncVelPIDController.
| ilogger | The logger this instance will log to. |
| std::shared_ptr< AsyncVelocityController< double, double > > okapi::AsyncVelControllerBuilder::build | ( | ) |
Builds the AsyncVelocityController.
Throws a std::runtime_exception is no motors were set.
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::notParentedToCurrentTask | ( | ) |
Prevents parenting the internal tasks started by this builder to the current task, meaning they will not be deleted once the current task is deleted.
This can cause runaway tasks, but is sometimes the desired behavior (e.x., if you want to use this builder once in autonomous and then again in opcontrol).
Read more about this in the [builders and tasks tutorial] (docs/tutorials/concepts/builders-and-tasks.md).
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::parentedToCurrentTask | ( | ) |
Parents the internal tasks started by this builder to the current task, meaning they will be deleted once the current task is deleted.
The initialize and competition_initialize tasks are never parented to. This is the default behavior.
Read more about this in the [builders and tasks tutorial] (docs/tutorials/concepts/builders-and-tasks.md).
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withDerivativeFilter | ( | std::unique_ptr< Filter > | iderivativeFilter | ) |
Sets the derivative filter which filters the derivative term before it is scaled by kD.
The filter is ignored when using integrated control. The default derivative filter is a PassthroughFilter.
| iderivativeFilter | The derivative filter. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withGains | ( | const IterativeVelPIDController::Gains & | igains | ) |
Sets the controller gains, causing the builder to generate an AsyncVelPIDController.
This does not set the integrated control's gains.
| igains | The gains. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withGearset | ( | const AbstractMotor::GearsetRatioPair & | igearset | ) |
Sets the gearset.
The default gearset is derived from the motor's.
| igearset | The gearset. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withLogger | ( | const std::shared_ptr< Logger > & | ilogger | ) |
Sets the logger.
| ilogger | The logger. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withMaxVelocity | ( | double | imaxVelocity | ) |
Sets the maximum velocity.
The default maximum velocity is derived from the motor's gearset. This parameter is ignored when using an AsyncVelPIDController.
| imaxVelocity | The maximum velocity. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withMotor | ( | const Motor & | imotor | ) |
Sets the motor.
| imotor | The motor. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withMotor | ( | const MotorGroup & | imotor | ) |
Sets the motor.
| imotor | The motor. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withMotor | ( | const std::shared_ptr< AbstractMotor > & | imotor | ) |
Sets the motor.
| imotor | The motor. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withSensor | ( | const ADIEncoder & | isensor | ) |
Sets the sensor.
The default sensor is the motor's integrated encoder.
| isensor | The sensor. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withSensor | ( | const IntegratedEncoder & | isensor | ) |
Sets the sensor.
The default sensor is the motor's integrated encoder.
| isensor | The sensor. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withSensor | ( | const std::shared_ptr< RotarySensor > & | isensor | ) |
Sets the sensor.
The default sensor is the motor's integrated encoder.
| isensor | The sensor. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withTimeUtilFactory | ( | const TimeUtilFactory & | itimeUtilFactory | ) |
Sets the TimeUtilFactory used when building the controller.
The default is the static TimeUtilFactory.
| itimeUtilFactory | The TimeUtilFactory. |
| AsyncVelControllerBuilder & okapi::AsyncVelControllerBuilder::withVelMath | ( | std::unique_ptr< VelMath > | ivelMath | ) |