The ShortcutProcessor searches shortcuts in C-Space to produce smooth trajectories.
More...
The ShortcutProcessor searches shortcuts in C-Space to produce smooth trajectories.
◆ ShortcutProcessor()
◆ ~ShortcutProcessor()
Saba::ShortcutProcessor::~ShortcutProcessor |
( |
| ) |
|
|
overridedefault |
◆ doPathPruning()
void Saba::ShortcutProcessor::doPathPruning |
( |
| ) |
|
Goes through path and checks if direct shortcut between node before to node behind current node is collision free. Has to be called multiple times in order to get a good result. Slow method, shortenSolutionRandom() gets similar results but is much faster.
◆ doShortcut()
int Saba::ShortcutProcessor::doShortcut |
( |
int |
startIndex, |
|
|
int |
endIndex |
|
) |
| |
Erase all intermediate points and add a straight line shortcut instead.
- Returns
- Number of saved points.
◆ initSolution()
bool Saba::ShortcutProcessor::initSolution |
( |
| ) |
|
|
protected |
◆ optimize()
CSpacePathPtr Saba::ShortcutProcessor::optimize |
( |
int |
optimizeSteps | ) |
|
|
overridevirtual |
◆ selectCandidatesRandom()
bool Saba::ShortcutProcessor::selectCandidatesRandom |
( |
int & |
storeStartIndex, |
|
|
int & |
storeEndIndex, |
|
|
int |
maxSolutionPathDist = 30 |
|
) |
| |
This method randomly choses a start and endpoint. The linear path between can be checked for validity in order to check for a shortcut.
◆ shortenSolutionRandom()
CSpacePathPtr Saba::ShortcutProcessor::shortenSolutionRandom |
( |
int |
shortenLoops = 300 , |
|
|
int |
maxSolutionPathDist = 30 |
|
) |
| |
Creates a shortened CSpace path.
- Parameters
-
shortenLoops | Calls tryRandomShort() shortenLoops times |
maxSolutionPathDist | The max solution path dist. |
- Returns
- The local instance of the optimized solution.
◆ tryRandomShortcut()
int Saba::ShortcutProcessor::tryRandomShortcut |
( |
int |
maxSolutionPathDist | ) |
|
|
protected |
◆ validShortcut()
bool Saba::ShortcutProcessor::validShortcut |
( |
int |
startIndex, |
|
|
int |
endIndex |
|
) |
| |
Checks linear path between start and end index. Therefore the cspace is queried.
- Returns
- If true is returned the shortcut is valid.
◆ cspace