-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Planning adapters #437
Merged
Merged
Planning adapters #437
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
045af5b
Add MetaSkeleton to ConfigurationToEndEffectorOffsetPlanner.
brianhou db39e95
Add more DART planners.
brianhou 56bf0aa
Add max samples to ConfigurationToTSR problem.
brianhou 0af77cf
Implement single-problem PlannerAdapter class.
brianhou 8ef4840
Implement single-problem DartPlannerAdapter class.
brianhou f7138f6
Add initial implementation of ConfigurationToConfiguration_to_Configu…
brianhou 949d523
Format code.
brianhou d84ad5f
Update ConfigurationToEndEffectorPose to MetaSkeletonStateSpace.
brianhou 4078529
Write DartSingleProblemPlanner. Change ConfigurationToConfigurationPl…
evil-sherdil ac6bcac
Update the other two DART planners to use DartSingleProblemPlanner.
evil-sherdil eb61f17
Rename dart::DartSingleProblemPlanner to dart::SingleProblemPlanner.
brianhou a51bb9e
Fix formatting.
brianhou fba0860
Update PlannerAdapter.
brianhou 5b61b44
Respond to nits from JS.
evil-sherdil aa5f107
Merge branch 'enhancement/brianhou/metaskeleton-planners' of https://…
evil-sherdil 3bbe3f8
Make SequenceMetaPlanner use CompositePlanner constructor.
evil-sherdil 883ce73
Respond to final nit from JS.
evil-sherdil 6d31683
Update CHANGELOG
evil-sherdil 74897e2
Add that line back in CHANGELOG.md
evil-sherdil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
include/aikido/planner/dart/ConfigurationToConfiguration_to_ConfigurationToTSR.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONTOCONFIGURATIONTOTSR_HPP_ | ||
#define AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONTOCONFIGURATIONTOTSR_HPP_ | ||
|
||
#include "aikido/planner/ConfigurationToConfigurationPlanner.hpp" | ||
#include "aikido/planner/dart/ConfigurationToTSRPlanner.hpp" | ||
#include "aikido/planner/dart/PlannerAdapter.hpp" | ||
|
||
namespace aikido { | ||
namespace planner { | ||
namespace dart { | ||
|
||
class ConfigurationToConfiguration_to_ConfigurationToTSR | ||
: public PlannerAdapter<ConfigurationToConfigurationPlanner, | ||
ConfigurationToTSRPlanner> | ||
{ | ||
public: | ||
ConfigurationToConfiguration_to_ConfigurationToTSR( | ||
std::shared_ptr<ConfigurationToConfigurationPlanner> planner, | ||
::dart::dynamics::MetaSkeletonPtr metaSkeleton); | ||
|
||
virtual trajectory::TrajectoryPtr plan( | ||
const ConfigurationToTSR& problem, Planner::Result* result) override; | ||
}; | ||
|
||
} // namespace dart | ||
} // namespace planner | ||
} // namespace aikido | ||
|
||
#endif // AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONTOCONFIGURATIONTOTSR_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef AIKIDO_PLANNER_DART_CONFIGURATIONTOTSRPLANNER_HPP_ | ||
#define AIKIDO_PLANNER_DART_CONFIGURATIONTOTSRPLANNER_HPP_ | ||
|
||
#include "aikido/planner/dart/ConfigurationToTSR.hpp" | ||
#include "aikido/planner/dart/SingleProblemPlanner.hpp" | ||
#include "aikido/statespace/dart/MetaSkeletonStateSpace.hpp" | ||
#include "aikido/trajectory/Trajectory.hpp" | ||
|
||
namespace aikido { | ||
namespace planner { | ||
namespace dart { | ||
|
||
/// Base planner class for ConfigurationToTSR planning problem. | ||
class ConfigurationToTSRPlanner | ||
: public dart::SingleProblemPlanner<ConfigurationToTSRPlanner, | ||
ConfigurationToTSR> | ||
{ | ||
public: | ||
// Expose the implementation of Planner::plan(const Problem&, Result*) in | ||
// SingleProblemPlanner. Note that plan() of the base class takes Problem | ||
// while the virtual function defined in this class takes SolvableProblem, | ||
// which is simply ConfigurationToTSR. | ||
using SingleProblemPlanner::plan; | ||
|
||
/// Constructor | ||
/// | ||
/// \param[in] stateSpace State space that this planner associated with. | ||
/// \param[in] metaSkeleton MetaSkeleton to use for planning. | ||
ConfigurationToTSRPlanner( | ||
statespace::dart::ConstMetaSkeletonStateSpacePtr stateSpace, | ||
::dart::dynamics::MetaSkeletonPtr metaSkeleton); | ||
|
||
/// Solves \c problem returning the result to \c result. | ||
/// | ||
/// \param[in] problem Planning problem to be solved by the planner. | ||
/// \param[out] result Result of planning procedure. | ||
virtual trajectory::TrajectoryPtr plan( | ||
const SolvableProblem& problem, Result* result = nullptr) | ||
= 0; | ||
// Note: SolvableProblem is defined in SingleProblemPlanner. | ||
}; | ||
|
||
} // namespace dart | ||
} // namespace planner | ||
} // namespace aikido | ||
|
||
#endif // AIKIDO_PLANNER_DART_CONFIGURATIONTOTSRPLANNER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#ifndef AIKIDO_PLANNER_DART_PLANNERADAPTER_HPP_ | ||
#define AIKIDO_PLANNER_DART_PLANNERADAPTER_HPP_ | ||
|
||
namespace aikido { | ||
namespace planner { | ||
namespace dart { | ||
|
||
/// Adapts a DelegatePlanner to solve the single problem that TargetPlanner can | ||
/// solve. | ||
/// | ||
/// \tparam DelegatePlanner type of \c SingleProblemPlanner to delegate to | ||
/// \tparam TargetPlanner type of \c dart::SingleProblemPlanner to implement | ||
template <typename DelegatePlanner, | ||
typename TargetPlanner, | ||
typename DelegateIsDartPlanner = void> | ||
class PlannerAdapter : public TargetPlanner | ||
{ | ||
public: | ||
/// Constructor to adapt non-DART planners. | ||
/// | ||
/// \param[in] planner Delegate planner to use internally. | ||
/// \param[in] metaSkeleton MetaSkeleton to use for planning. | ||
explicit PlannerAdapter( | ||
std::shared_ptr<DelegatePlanner> planner, | ||
::dart::dynamics::MetaSkeletonPtr metaSkeleton); | ||
|
||
/// Default destructor. | ||
virtual ~PlannerAdapter() = default; | ||
|
||
protected: | ||
/// Internal planner to delegate planning calls | ||
std::shared_ptr<DelegatePlanner> mDelegate; | ||
}; | ||
|
||
/// Adapts a DelegatePlanner to solve the single problem that TargetPlanner can | ||
/// solve. | ||
/// | ||
/// \tparam DelegatePlanner type of \c dart::SingleProblemPlanner to delegate to | ||
/// \tparam TargetPlanner type of \c dart::SingleProblemPlanner to implement | ||
template <typename DelegatePlanner, typename TargetPlanner> | ||
class | ||
PlannerAdapter<DelegatePlanner, | ||
TargetPlanner, | ||
typename std:: | ||
enable_if<std:: | ||
is_base_of<dart:: | ||
SingleProblemPlanner<DelegatePlanner, | ||
typename DelegatePlanner:: | ||
SolvableProblem>, | ||
DelegatePlanner>::value>::type> | ||
{ | ||
public: | ||
/// Constructor to adapt DART planners. | ||
/// | ||
/// \param[in] planner DART delegate planner to use internally. | ||
explicit PlannerAdapter(std::shared_ptr<DelegatePlanner> planner); | ||
|
||
/// Default destructor. | ||
virtual ~PlannerAdapter() = default; | ||
|
||
protected: | ||
/// Internal planner to delegate planning calls | ||
std::shared_ptr<DelegatePlanner> mDelegate; | ||
}; | ||
|
||
} // namespace dart | ||
} // namespace planner | ||
} // namespace aikido | ||
|
||
#include "aikido/planner/dart/detail/PlannerAdapter-impl.hpp" | ||
|
||
#endif // AIKIDO_PLANNER_DART_PLANNERADAPTER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef AIKIDO_PLANNER_DART_SINGLEPROBLEMPLANNER_HPP_ | ||
#define AIKIDO_PLANNER_DART_SINGLEPROBLEMPLANNER_HPP_ | ||
|
||
#include "aikido/planner/SingleProblemPlanner.hpp" | ||
#include "aikido/statespace/dart/MetaSkeletonStateSpace.hpp" | ||
|
||
namespace aikido { | ||
namespace planner { | ||
namespace dart { | ||
|
||
/// Base planner class for all DART single problem planners. Avoids copying | ||
/// MetaSkeleton related code a bunch of times. | ||
template <typename Derived, typename ProblemT> | ||
class SingleProblemPlanner | ||
: public planner::SingleProblemPlanner<Derived, ProblemT> | ||
{ | ||
public: | ||
/// Constructor | ||
/// | ||
/// \param[in] stateSpace State space that this planner associated with. | ||
/// \param[in] metaSkeleton MetaSkeleton to use for planning. | ||
SingleProblemPlanner( | ||
statespace::dart::ConstMetaSkeletonStateSpacePtr stateSpace, | ||
::dart::dynamics::MetaSkeletonPtr metaSkeleton); | ||
|
||
/// Return this planner's MetaSkeletonStateSpace. | ||
statespace::dart::ConstMetaSkeletonStateSpacePtr getMetaSkeletonStateSpace() | ||
const; | ||
|
||
/// Return this planner's MetaSkeleton. | ||
::dart::dynamics::MetaSkeletonPtr getMetaSkeleton(); | ||
|
||
protected: | ||
/// Stores stateSpace pointer as a ConstMetaSkeletonStateSpacePtr. Prevents | ||
/// use of an expensive dynamic cast. | ||
statespace::dart::ConstMetaSkeletonStateSpacePtr mMetaSkeletonStateSpace; | ||
|
||
/// MetaSkeleton to use for planning. | ||
::dart::dynamics::MetaSkeletonPtr mMetaSkeleton; | ||
}; | ||
|
||
} // namespace dart | ||
} // namespace planner | ||
} // namespace aikido | ||
|
||
#include "aikido/planner/dart/detail/SingleProblemPlanner-impl.hpp" | ||
|
||
#endif // AIKIDO_PLANNER_DART_SINGLEPROBLEMPLANNER_HPP_ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Grouping the goal related arguments would make sense so that the argument order becomes
startState
->maxSamples
->goalTSR
orstartState
->goalTSR
->maxSamples
.