Skip to content

Commit

Permalink
Reverted: KEEP LOCAL: Added collision check counter to path shortener.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaskunz committed Apr 16, 2012
1 parent 3c9c08a commit e09a3a1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions librst/Tools/PathShortener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using namespace std;
using namespace Eigen;

extern int numCollisionChecks;

#define RAND12(N1,N2) N1 + ((N2-N1) * ((double)rand() / ((double)RAND_MAX + 1))) // random # between N&M

PathShortener::PathShortener() {}
Expand All @@ -26,7 +24,7 @@ void PathShortener::shortenPath(list<VectorXd> &path)
printf("--> Start Brute Force Shortener \n");
srand(time(NULL));

const int numShortcuts = path.size() * 20;
const int numShortcuts = path.size() * 5;

// Number of checks
for( int count = 0; count < numShortcuts; count++ ) {
Expand Down Expand Up @@ -79,7 +77,6 @@ bool PathShortener::segmentCollisionFree(list<VectorXd> &intermediatePoints, con

VectorXd midpoint = (double)n2 / (double)n * config1 + (double)n1 / (double)n * config2;
list<VectorXd> intermediatePoints1, intermediatePoints2;
numCollisionChecks++;
world->robots[robotId]->setConf(linkIds, midpoint);
if(!world->checkCollisions() && segmentCollisionFree(intermediatePoints1, config1, midpoint)
&& segmentCollisionFree(intermediatePoints2, midpoint, config2))
Expand Down

0 comments on commit e09a3a1

Please sign in to comment.