Skip to content

Commit e90d24e

Browse files
dqyi11brianhou
authored andcommitted
Fix segment fault on 32-bit machine (#459)
* fix memory leak * increase timelimit for success rate * update CHANGELOG * change to use scopedState * Update CHANGELOG.md * Minor wording fix.
1 parent d04de5b commit e90d24e

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
* Changed interface for TrajectoryPostProcessor: [#341](https://github.com/personalrobotics/aikido/pull/341)
5151
* Planning calls with InverseKinematicsSampleable constraints explicitly set MetaSkeleton to solve IK with: [#379](https://github.com/personalrobotics/aikido/pull/379)
5252
* Added a kinodynamic timer that generates a time-optimal smooth trajectory without completely stopping at each waypoint: [#443](https://github.com/personalrobotics/aikido/pull/443)
53+
* Fixed segmentation fault on 32-bit machines in vector-field planner: [#459](https://github.com/personalrobotics/aikido/pull/459)
5354

5455
* Robot
5556

src/planner/vectorfield/detail/VectorFieldIntegrator.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ VectorFieldIntegrator::VectorFieldIntegrator(
5454
double checkConstraintResolution)
5555
: mVectorField(vectorField)
5656
, mConstraint(collisionFreeConstraint)
57+
, mCacheIndex(-1)
58+
, mDimension(mVectorField->getStateSpace()->getDimension())
5759
, mTimelimit(timelimit)
5860
, mConstraintCheckResolution(checkConstraintResolution)
61+
, mState(mVectorField->getStateSpace()->createState())
62+
, mLastEvaluationTime(0.0)
5963
{
60-
mCacheIndex = -1;
61-
mLastEvaluationTime = 0.0;
62-
mDimension = mVectorField->getStateSpace()->getDimension();
63-
mState = mVectorField->getStateSpace()->createState();
64+
// Do nothing
6465
}
6566

6667
//==============================================================================

src/planner/vectorfield/detail/VectorFieldIntegrator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class VectorFieldIntegrator
115115
double mConstraintCheckResolution;
116116

117117
/// Current state in integration
118-
aikido::statespace::StateSpace::State* mState;
118+
aikido::statespace::StateSpace::ScopedState mState;
119119

120120
/// Last evaluation time in checking trajectory
121121
double mLastEvaluationTime;

tests/planner/vectorfield/test_VectorFieldPlanner.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ TEST_F(VectorFieldPlannerTest, PlanToEndEffectorOffsetTest)
331331

332332
double positionTolerance = 0.01;
333333
double angularTolerance = 0.15;
334-
double initialStepSize = 0.001;
334+
double initialStepSize = 0.01;
335335
double jointLimitTolerance = 1e-3;
336-
double constraintCheckResolution = 1e-3;
337-
std::chrono::duration<double> timelimit(10.0);
336+
double constraintCheckResolution = 1e-2;
337+
std::chrono::duration<double> timelimit(60.0);
338338

339339
// Create problem.
340340
auto offsetProblem = ConfigurationToEndEffectorOffset(
@@ -453,9 +453,9 @@ TEST_F(VectorFieldPlannerTest, PlanToEndEffectorPoseTest)
453453
double poseErrorTolerance = 0.01;
454454
double initialStepSize = 0.05;
455455
double r = 1.0;
456-
double jointLimitTolerance = 1e-3;
457-
double constraintCheckResolution = 1e-3;
458-
std::chrono::duration<double> timelimit(5.);
456+
double jointLimitTolerance = 1e-2;
457+
double constraintCheckResolution = 1e-2;
458+
std::chrono::duration<double> timelimit(300.);
459459

460460
mSkel->setPositions(mStartConfig);
461461

0 commit comments

Comments
 (0)