Skip to content

Commit

Permalink
assertion for equal numWaypoints added
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-vk committed Apr 26, 2017
1 parent 79329bd commit d69aec4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/planner/ompl/test_TrajectoryConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace {
}

// Test if the durations of the two trajectories remains constant
TEST_F(PlannerTest, OMPLDurationRemainsUnchanged)
TEST_F(PlannerTest, OMPLNumWaypointsUnchanged)
{
Eigen::Vector3d startPose(-5, -5, 0);
Eigen::Vector3d midwayPose(0, -2, 0);
Expand Down Expand Up @@ -103,6 +103,9 @@ TEST_F(PlannerTest, OMPLStatesRemainUnchaged)
auto omplTraj = aikido::planner::ompl::toOMPLTrajectory(
traj, si);

// Ensure equal waypoints
ASSERT_TRUE(traj->getNumWaypoints() == omplTraj.getStateCount());

// Match every point
for(size_t idx = 0; idx < traj->getNumWaypoints(); ++idx)
{
Expand All @@ -119,7 +122,7 @@ TEST_F(PlannerTest, OMPLStatesRemainUnchaged)


// Tests that toInterpolatedTrajectory function does not alter the duration
TEST_F(PlannerTest, InterpolatedDurationRemainsUnchaged)
TEST_F(PlannerTest, InterpolatedNumWaypointsUnchaged)
{
Eigen::Vector3d startPose(-5, -5, 0);
Eigen::Vector3d midwayPose(0, -2, 0);
Expand Down Expand Up @@ -176,6 +179,9 @@ TEST_F(PlannerTest, InterpolatedStatesRemainUnchaged)
auto interpolatedTraj = aikido::planner::ompl::toInterpolatedTrajectory(
omplTraj, interpolator);

// Ensure equal waypoints
ASSERT_TRUE(interpolatedTraj->getNumWaypoints() == omplTraj.getStateCount());

// Match every point
for(size_t idx = 0; idx < interpolatedTraj->getNumWaypoints(); ++idx)
{
Expand Down

0 comments on commit d69aec4

Please sign in to comment.