Performs velocity control while staying in positional bounds, obeying acceleration / deceleration and staying below a velocity bound.
More...
Performs velocity control while staying in positional bounds, obeying acceleration / deceleration and staying below a velocity bound.
we can have 4 cases:
- 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)
- we directly set v and ignore acc/dec (if |currentV - targetV| <= directSetVLimit)
- we need to accelerate (if currentV and targetV have same sign and |currentV| < |currentV|)
- we need to decelerate (other cases)
- Parameters
-
dt | The time in seconds until the next call is made. (use the time since the last call as an approximate) |
maxDt | Limits dt in case the given approximation has a sudden high value. |
currentV | |
targetV | |
maxV | |
acceleration | |
deceleration | |
directSetVLimit | In 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.