Skip to content

Commit

Permalink
Delete old post-processor code. (#581)
Browse files Browse the repository at this point in the history
* Delete old PP code.

* Update CL.

* Update CHANGELOG.md

Co-authored-by: Brian Hou <brianhou@users.noreply.github.com>
  • Loading branch information
evil-sherdil and brianhou authored Aug 27, 2020
1 parent 60abdca commit 90a6e0f
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 203 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Planner

* Defined post-processor parameter structs in AIKIDO: [#579](https://github.com/personalrobotics/aikido/pull/579)
* Deleted old post-processor interface: [#581](https://github.com/personalrobotics/aikido/pull/581)

### 0.3.0 (2020-05-22)

Expand Down
18 changes: 0 additions & 18 deletions include/aikido/robot/ConcreteManipulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,6 @@ class ConcreteManipulator : public Manipulator
// Documentation inherited.
virtual ConstHandPtr getHand() const override;

// Documentation inherited.
virtual std::unique_ptr<aikido::trajectory::Spline> smoothPath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
const constraint::TestablePtr& constraint) override;

// Documentation inherited.
virtual std::unique_ptr<aikido::trajectory::Spline> retimePath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path) override;

// Documentation inherited.
virtual std::unique_ptr<aikido::trajectory::Spline> retimePathWithKunz(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
double maxDeviation,
double timestep) override;

// Documentation inherited.
virtual std::future<void> executeTrajectory(
const trajectory::TrajectoryPtr& trajectory) const override;
Expand Down
32 changes: 0 additions & 32 deletions include/aikido/robot/ConcreteRobot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,6 @@ class ConcreteRobot : public Robot

virtual ~ConcreteRobot() = default;

// Documentation inherited.
virtual aikido::trajectory::UniqueSplinePtr smoothPath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
const constraint::TestablePtr& constraint) override;

// Documentation inherited.
virtual aikido::trajectory::UniqueSplinePtr retimePath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path) override;

// Documentation inherited.
virtual std::unique_ptr<aikido::trajectory::Spline> retimePathWithKunz(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
double maxDeviation,
double timestep) override;

// Documentation inherited.
virtual std::future<void> executeTrajectory(
const trajectory::TrajectoryPtr& trajectory) const override;
Expand Down Expand Up @@ -112,20 +94,6 @@ class ConcreteRobot : public Robot
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const constraint::dart::CollisionFreePtr& collisionFree) const override;

// Get a smoothing post postprocessor that respects velocity and acceleration
// limits, as well as the passed constraint.
/// \param[in] metaSkeleton The MetaSkeleton whose limits must be respected.
std::shared_ptr<aikido::planner::TrajectoryPostProcessor>
getTrajectoryPostProcessor(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
bool enableShortcut,
bool enableBlend,
double shortcutTimelimit,
double blendRadius,
int blendIterations,
double feasibilityCheckResolution,
double feasibilityApproxTolerance) const;

/// Get a postprocessor that respects velocity and acceleration limits. The
/// specific postprocessor returned is controlled by `postProcessorParams`.
/// \param[in] metaSkeleton Metaskeleton of the path.
Expand Down
31 changes: 0 additions & 31 deletions include/aikido/robot/Robot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,6 @@ class Robot
public:
virtual ~Robot() = default;

/// Returns a timed trajectory that can be executed by the robot.
/// \param[in] metaSkeleton Metaskeleton of the path.
/// \param[in] path Geometric path to execute.
/// \param[in] constraint Must be satisfied after postprocessing. Typically
/// collision constraint is passed.
virtual std::unique_ptr<aikido::trajectory::Spline> smoothPath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
const constraint::TestablePtr& constraint)
= 0;

/// Returns a timed trajectory that can be executed by the robot.
/// \param[in] metaSkeleton Metaskeleton of the path.
/// \param[in] path Geometric path to execute.
virtual std::unique_ptr<aikido::trajectory::Spline> retimePath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path)
= 0;

/// Returns a timed trajectory computed with KunzRetimer
/// \param[in] metaSkeleton Metaskeleton of the path.
/// \param[in] path Geometric path to execute.
/// \param[in] maxDeviation Maximum deviation allowed from original path.
/// \param[in] timestep Time step between trajectory points.
virtual std::unique_ptr<aikido::trajectory::Spline> retimePathWithKunz(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
double maxDeviation,
double timestep)
= 0;

/// Executes a trajectory
/// \param[in] trajectory Timed trajectory to execute
virtual std::future<void> executeTrajectory(
Expand Down
28 changes: 0 additions & 28 deletions src/robot/ConcreteManipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,6 @@ ConstHandPtr ConcreteManipulator::getHand() const
return mHand;
}

//==============================================================================
std::unique_ptr<aikido::trajectory::Spline> ConcreteManipulator::smoothPath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
const constraint::TestablePtr& constraint)
{
return mRobot->smoothPath(metaSkeleton, path, constraint);
}

//==============================================================================
std::unique_ptr<aikido::trajectory::Spline> ConcreteManipulator::retimePath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path)
{
return mRobot->retimePath(metaSkeleton, path);
}

//==============================================================================
std::unique_ptr<aikido::trajectory::Spline>
ConcreteManipulator::retimePathWithKunz(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
double maxDeviation,
double timestep)
{
return mRobot->retimePathWithKunz(metaSkeleton, path, maxDeviation, timestep);
}

//==============================================================================
std::future<void> ConcreteManipulator::executeTrajectory(
const trajectory::TrajectoryPtr& trajectory) const
Expand Down
94 changes: 0 additions & 94 deletions src/robot/ConcreteRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,73 +120,6 @@ ConcreteRobot::ConcreteRobot(
mParentSkeleton = mMetaSkeleton->getBodyNode(0)->getSkeleton();
}

//==============================================================================
UniqueSplinePtr ConcreteRobot::smoothPath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
const constraint::TestablePtr& constraint)
{
Eigen::VectorXd velocityLimits = getVelocityLimits(*metaSkeleton);
Eigen::VectorXd accelerationLimits = getAccelerationLimits(*metaSkeleton);
auto smoother
= std::make_shared<ParabolicSmoother>(velocityLimits, accelerationLimits);

auto interpolated = dynamic_cast<const Interpolated*>(path);
if (interpolated)
return smoother->postprocess(
*interpolated, *(cloneRNG().get()), constraint);

auto spline = dynamic_cast<const Spline*>(path);
if (spline)
return smoother->postprocess(*spline, *(cloneRNG().get()), constraint);

throw std::invalid_argument("Path should be either Spline or Interpolated.");
}

//==============================================================================
UniqueSplinePtr ConcreteRobot::retimePath(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path)
{
Eigen::VectorXd velocityLimits = getVelocityLimits(*metaSkeleton);
Eigen::VectorXd accelerationLimits = getAccelerationLimits(*metaSkeleton);
auto retimer
= std::make_shared<ParabolicTimer>(velocityLimits, accelerationLimits);

auto interpolated = dynamic_cast<const Interpolated*>(path);
if (interpolated)
return retimer->postprocess(*interpolated, *(cloneRNG().get()));

auto spline = dynamic_cast<const Spline*>(path);
if (spline)
return retimer->postprocess(*spline, *(cloneRNG().get()));

throw std::invalid_argument("Path should be either Spline or Interpolated.");
}

//==============================================================================
UniqueSplinePtr ConcreteRobot::retimePathWithKunz(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
const aikido::trajectory::Trajectory* path,
double maxDeviation,
double timestep)
{
Eigen::VectorXd velocityLimits = getVelocityLimits(*metaSkeleton);
Eigen::VectorXd accelerationLimits = getAccelerationLimits(*metaSkeleton);
auto retimer = std::make_shared<KunzRetimer>(
velocityLimits, accelerationLimits, maxDeviation, timestep);

auto interpolated = dynamic_cast<const Interpolated*>(path);
if (interpolated)
return retimer->postprocess(*interpolated, *(cloneRNG().get()));

auto spline = dynamic_cast<const Spline*>(path);
if (spline)
return retimer->postprocess(*spline, *(cloneRNG().get()));

throw std::invalid_argument("Path should be either Spline or Interpolated.");
}

//==============================================================================
std::future<void> ConcreteRobot::executeTrajectory(
const TrajectoryPtr& trajectory) const
Expand Down Expand Up @@ -304,33 +237,6 @@ TestablePtr ConcreteRobot::getFullCollisionConstraint(
return std::make_shared<TestableIntersection>(space, constraints);
}

//==============================================================================
std::shared_ptr<TrajectoryPostProcessor>
ConcreteRobot::getTrajectoryPostProcessor(
const dart::dynamics::MetaSkeletonPtr& metaSkeleton,
bool enableShortcut,
bool enableBlend,
double shortcutTimelimit,
double blendRadius,
int blendIterations,
double feasibilityCheckResolution,
double feasibilityApproxTolerance) const
{
Eigen::VectorXd velocityLimits = getVelocityLimits(*metaSkeleton);
Eigen::VectorXd accelerationLimits = getAccelerationLimits(*metaSkeleton);

return std::make_shared<ParabolicSmoother>(
velocityLimits,
accelerationLimits,
enableShortcut,
enableBlend,
shortcutTimelimit,
blendRadius,
blendIterations,
feasibilityCheckResolution,
feasibilityApproxTolerance);
}

//==============================================================================
TrajectoryPtr ConcreteRobot::planToConfiguration(
const MetaSkeletonStateSpacePtr& stateSpace,
Expand Down

0 comments on commit 90a6e0f

Please sign in to comment.