LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::AsyncMotionProfileControllerBuilder Class Reference

#include <asyncMotionProfileControllerBuilder.hpp>

Public Member Functions

 AsyncMotionProfileControllerBuilder (const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
 A builder that creates async motion profile controllers.
 
AsyncMotionProfileControllerBuilderwithOutput (const Motor &ioutput, const QLength &idiameter, const AbstractMotor::GearsetRatioPair &ipair)
 Sets the output.
 
AsyncMotionProfileControllerBuilderwithOutput (const MotorGroup &ioutput, const QLength &idiameter, const AbstractMotor::GearsetRatioPair &ipair)
 Sets the output.
 
AsyncMotionProfileControllerBuilderwithOutput (const std::shared_ptr< ControllerOutput< double > > &ioutput, const QLength &idiameter, const AbstractMotor::GearsetRatioPair &ipair)
 Sets the output.
 
AsyncMotionProfileControllerBuilderwithOutput (ChassisController &icontroller)
 Sets the output.
 
AsyncMotionProfileControllerBuilderwithOutput (const std::shared_ptr< ChassisController > &icontroller)
 Sets the output.
 
AsyncMotionProfileControllerBuilderwithOutput (const std::shared_ptr< ChassisModel > &imodel, const ChassisScales &iscales, const AbstractMotor::GearsetRatioPair &ipair)
 Sets the output.
 
AsyncMotionProfileControllerBuilderwithLimits (const PathfinderLimits &ilimits)
 Sets the limits.
 
AsyncMotionProfileControllerBuilderwithTimeUtilFactory (const TimeUtilFactory &itimeUtilFactory)
 Sets the TimeUtilFactory used when building the controller.
 
AsyncMotionProfileControllerBuilderwithLogger (const std::shared_ptr< Logger > &ilogger)
 Sets the logger.
 
AsyncMotionProfileControllerBuilderparentedToCurrentTask ()
 Parents the internal tasks started by this builder to the current task, meaning they will be deleted once the current task is deleted.
 
AsyncMotionProfileControllerBuildernotParentedToCurrentTask ()
 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< AsyncLinearMotionProfileControllerbuildLinearMotionProfileController ()
 Builds the AsyncLinearMotionProfileController.
 
std::shared_ptr< AsyncMotionProfileControllerbuildMotionProfileController ()
 Builds the AsyncMotionProfileController.
 

Detailed Description

Definition at line 17 of file asyncMotionProfileControllerBuilder.hpp.

Constructor & Destructor Documentation

◆ AsyncMotionProfileControllerBuilder()

okapi::AsyncMotionProfileControllerBuilder::AsyncMotionProfileControllerBuilder ( const std::shared_ptr< Logger > &  ilogger = Logger::getDefaultLogger())
explicit

A builder that creates async motion profile controllers.

Use this to build an AsyncMotionProfileController or an AsyncLinearMotionProfileController.

Parameters
iloggerThe logger this instance will log to.

Member Function Documentation

◆ buildLinearMotionProfileController()

std::shared_ptr< AsyncLinearMotionProfileController > okapi::AsyncMotionProfileControllerBuilder::buildLinearMotionProfileController ( )

◆ buildMotionProfileController()

std::shared_ptr< AsyncMotionProfileController > okapi::AsyncMotionProfileControllerBuilder::buildMotionProfileController ( )

◆ notParentedToCurrentTask()

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::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).

Returns
An ongoing builder.

◆ parentedToCurrentTask()

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::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).

Returns
An ongoing builder.

◆ withLimits()

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withLimits ( const PathfinderLimits ilimits)

Sets the limits.

Parameters
ilimitsThe limits.
Returns
An ongoing builder.

◆ withLogger()

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withLogger ( const std::shared_ptr< Logger > &  ilogger)

Sets the logger.

Parameters
iloggerThe logger.
Returns
An ongoing builder.

◆ withOutput() [1/6]

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withOutput ( ChassisController icontroller)

Sets the output.

This must be used with buildMotionProfileController().

Parameters
icontrollerThe chassis controller to use.
Returns
An ongoing builder.

◆ withOutput() [2/6]

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withOutput ( const Motor ioutput,
const QLength &  idiameter,
const AbstractMotor::GearsetRatioPair ipair 
)

Sets the output.

This must be used with buildLinearMotionProfileController().

Parameters
ioutputThe output.
idiameterThe diameter of the mechanical part the motor spins.
ipairThe gearset.
Returns
An ongoing builder.

◆ withOutput() [3/6]

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withOutput ( const MotorGroup ioutput,
const QLength &  idiameter,
const AbstractMotor::GearsetRatioPair ipair 
)

Sets the output.

This must be used with buildLinearMotionProfileController().

Parameters
ioutputThe output.
idiameterThe diameter of the mechanical part the motor spins.
ipairThe gearset.
Returns
An ongoing builder.

◆ withOutput() [4/6]

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withOutput ( const std::shared_ptr< ChassisController > &  icontroller)

Sets the output.

This must be used with buildMotionProfileController().

Parameters
icontrollerThe chassis controller to use.
Returns
An ongoing builder.

◆ withOutput() [5/6]

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withOutput ( const std::shared_ptr< ChassisModel > &  imodel,
const ChassisScales iscales,
const AbstractMotor::GearsetRatioPair ipair 
)

Sets the output.

This must be used with buildMotionProfileController().

Parameters
imodelThe chassis model to use.
iscalesThe chassis dimensions.
ipairThe gearset.
Returns
An ongoing builder.

◆ withOutput() [6/6]

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withOutput ( const std::shared_ptr< ControllerOutput< double > > &  ioutput,
const QLength &  idiameter,
const AbstractMotor::GearsetRatioPair ipair 
)

Sets the output.

This must be used with buildLinearMotionProfileController().

Parameters
ioutputThe output.
idiameterThe diameter of the mechanical part the motor spins.
ipairThe gearset.
Returns
An ongoing builder.

◆ withTimeUtilFactory()

AsyncMotionProfileControllerBuilder & okapi::AsyncMotionProfileControllerBuilder::withTimeUtilFactory ( const TimeUtilFactory itimeUtilFactory)

Sets the TimeUtilFactory used when building the controller.

The default is the static TimeUtilFactory.

Parameters
itimeUtilFactoryThe TimeUtilFactory.
Returns
An ongoing builder.

The documentation for this class was generated from the following file: