VelocityControllerWithAccelerationAndPositionBounds Struct Reference

Performs velocity control while staying in positional bounds, obeying acceleration / deceleration and staying below a velocity bound. More...

#include <RobotAPI/components/units/RobotUnit/BasicControllers.h>

+ Inheritance diagram for VelocityControllerWithAccelerationAndPositionBounds:

Public Member Functions

float run () const
 
bool validParameters () const
 
- Public Member Functions inherited from VelocityControllerWithAccelerationBounds
float estimateTime () const
 
float run () const
 
bool validParameters () const
 

Public Attributes

float currentPosition
 
float positionLimitHiSoft
 
float positionLimitLoSoft
 
- Public Attributes inherited from VelocityControllerWithAccelerationBounds
float acceleration
 
float currentV
 
float deceleration
 
float directSetVLimit
 
float dt
 
float maxDt
 
float maxV
 
float targetV
 

Detailed Description

Performs velocity control while staying in positional bounds, obeying acceleration / deceleration and staying below a velocity bound.

we can have 4 cases:

  1. we need to decelerate now or we will violate the position limits (maybe we still will violate them. e.f. if we already violate them or the robot can't brake fast enough)
  2. we directly set v and ignore acc/dec (if |currentV - targetV| <= directSetVLimit)
  3. we need to accelerate (if currentV and targetV have same sign and |currentV| < |currentV|)
  4. we need to decelerate (other cases)
    Parameters
    dtThe time in seconds until the next call is made. (use the time since the last call as an approximate)
    maxDtLimits dt in case the given approximation has a sudden high value.
    currentV
    targetV
    maxV
    acceleration
    deceleration
    directSetVLimitIn case |currentV - targetV| <= directSetVLimit this function will return targetV (if the position bounds are not violated)
    currentPosition
    positionLimitLo
    positionLimitHi
    Returns
    The next velocity.

Definition at line 272 of file BasicControllers.h.

Member Function Documentation

◆ run()

float run ( ) const

Definition at line 494 of file BasicControllers.cpp.

+ Here is the call graph for this function:

◆ validParameters()

bool validParameters ( ) const

Definition at line 485 of file BasicControllers.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ currentPosition

float currentPosition

Definition at line 276 of file BasicControllers.h.

◆ positionLimitHiSoft

float positionLimitHiSoft

Definition at line 278 of file BasicControllers.h.

◆ positionLimitLoSoft

float positionLimitLoSoft

Definition at line 277 of file BasicControllers.h.


The documentation for this struct was generated from the following files: