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.

Member Function Documentation

◆ run()

float run ( ) const

◆ validParameters()

bool validParameters ( ) const

Member Data Documentation

◆ currentPosition

float currentPosition

◆ positionLimitHiSoft

float positionLimitHiSoft

◆ positionLimitLoSoft

float positionLimitLoSoft

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