Skip to content
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

Fix issues discovered during demo. #442

Merged
merged 64 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e24c163
Test with COnfitoConf and seems to work!
evil-sherdil May 29, 2018
411aba5
Add getTrajectoryPostProcessor() method to ConcreteRobot class.
evil-sherdil May 29, 2018
05fac7c
Make ConfigurationToEndEffectorOffset and ConfigurationToTSR problems…
evil-sherdil May 31, 2018
497e474
HACK: Make ConfigurationToEndEffectorOffset getDirection() method ret…
evil-sherdil May 31, 2018
54f23a5
Fix ConfigurationToConfiguration_to_ConfigurationToTSR adapter now th…
evil-sherdil May 31, 2018
349d294
HACK: Fix hack for returning current BN direction in Offset problem (…
evil-sherdil May 31, 2018
4ffcdaa
HACK: Get around HERB hand BN not being in arm metaSkeleton, and null…
evil-sherdil May 31, 2018
c7d2c34
HACK: Update hacks to work with MAGI.
evil-sherdil Jun 1, 2018
0ac8554
HACK: Got left out of last commit.
evil-sherdil Jun 1, 2018
f17d866
HACK: Cap samples in DART TSR adapter. Use better random seed.
evil-sherdil Jun 1, 2018
689e718
Make getTrajectoryPostProcessor take needed args.
evil-sherdil Jun 1, 2018
c8c5873
Make getTrajectoryPostProcessor take constraint checking params.
evil-sherdil Jun 1, 2018
fff03e9
Do BN check in TSR adapter correctly by using the skeleton.
evil-sherdil Jun 5, 2018
08fc93b
Add RNG to ConfigurationToConfiguration_to_ConfigurationToTSR.
evil-sherdil Jun 5, 2018
c283296
Remove startState from DART problems. Need to fix tests.
evil-sherdil Jun 5, 2018
7dca09c
Add DART ConfigurationToConfigurationPlanner.
evil-sherdil Jun 5, 2018
feed4d8
Add new adapter that turns non-DART ConfTOConf planner into a DART one.
evil-sherdil Jun 5, 2018
894beeb
Update tests for removing startState from DART problems.
evil-sherdil Jun 5, 2018
1b51253
Run make format on last commit.
evil-sherdil Jun 5, 2018
cc661e1
Fix tests from adding RNG to TSR adapter.
evil-sherdil Jun 5, 2018
ea2ad17
Fix naming ambiguity that made TSR adapter not build.
evil-sherdil Jun 5, 2018
3458ef7
Use boost:none instead of zero vector to get straight direction in of…
evil-sherdil Jun 5, 2018
a939cc6
Make Offset problem take optional as reference.
evil-sherdil Jun 6, 2018
c63b74e
Clean up Offset problem comments and restore zero vector check.
evil-sherdil Jun 6, 2018
714c26f
Remove TSR adapter hack to prevent inf loops.
evil-sherdil Jun 6, 2018
40b1207
HACK BODY NODE FALLS OFF
personalrobot Jun 7, 2018
85eee66
HACK HACK HACK.
personalrobot Jun 8, 2018
42cd655
HACK HACK JH
evil-sherdil Jun 8, 2018
40482d3
HACK: IKJDSHFKJDSHFKJDSHFKDSHFLJDHFSKJHDSFKJDHF
personalrobot Jun 8, 2018
72e73f8
Revert "HACK: IKJDSHFKJDSHFKJDSHFKDSHFLJDHFSKJHDSFKJDHF"
evil-sherdil Jun 8, 2018
ec70b2f
Revert "HACK HACK JH"
evil-sherdil Jun 8, 2018
1e212b2
Revert "HACK HACK HACK."
evil-sherdil Jun 8, 2018
ee13b26
Revert "HACK BODY NODE FALLS OFF"
evil-sherdil Jun 8, 2018
460de14
Merge branch 'master' of https://github.com/personalrobotics/aikido i…
evil-sherdil Jun 11, 2018
69ec10e
Update ConfigurationToEndEffectorOffset to use multiple constructors.
evil-sherdil Jun 11, 2018
9f6dc86
Update getStartState in ConfigurationToEndEffectorOffset.
evil-sherdil Jun 11, 2018
a8c8ed7
Update ConfigurationToEndEffectorPose to use two constructors and res…
evil-sherdil Jun 11, 2018
382fa79
Update ConfigurationToTSR to use multiple constructors and restore ge…
evil-sherdil Jun 11, 2018
976b443
Update TSR adapter to just use getStartState().
evil-sherdil Jun 11, 2018
2177478
Pass start state to VFP.
evil-sherdil Jun 11, 2018
9872574
Revert "Update TSR adapter to just use getStartState()."
evil-sherdil Jun 12, 2018
6f50352
UpdateDART planning problems to not return dangling pointers with get…
evil-sherdil Jun 13, 2018
9cbc9d3
Draft dart/ConfigurationToConfiguration.hpp
evil-sherdil Jun 13, 2018
3944df6
Draft dart/ConfigurationToConfiguration.cpp
evil-sherdil Jun 17, 2018
18acbc3
Make adapter use right ConfigToConfig Problem.
evil-sherdil Jun 18, 2018
3527ed9
Trim fat in new getTrajectoryPostProcessor method.
evil-sherdil Jun 20, 2018
0193fd6
Fix tests with what we have now.
evil-sherdil Jun 21, 2018
b566978
Run make format.
evil-sherdil Jun 21, 2018
b442e8f
Make Planner take RNG.
evil-sherdil Jun 21, 2018
f20fd9c
Add rng arg to SingleProblemPlanner and ConfigurationToConfigurationP…
evil-sherdil Jun 22, 2018
75bc729
Use delegate RNG in TSR adapter. Make tests build again.
evil-sherdil Jun 22, 2018
d2dfa3e
Move getEndEffectorDirection into robot/util
evil-sherdil Jun 22, 2018
28d22f2
Create planner/dart/util and put getEndEffectorDirection there instead.
evil-sherdil Jun 22, 2018
48e98df
Change Planner to take raw RNG pointer, and getRng to return this raw…
evil-sherdil Jun 23, 2018
c183100
Respond to nits.
evil-sherdil Jun 24, 2018
76fe14b
Fix RNG destruction in Planner class.
evil-sherdil Jun 24, 2018
055cbb1
Repond to latest review comments.
evil-sherdil Jun 29, 2018
437b63e
Remove some std::moves to fix RVO build issue with OSX.
evil-sherdil Jun 29, 2018
e138d30
Nab one std::move missed by the last commit..
evil-sherdil Jul 3, 2018
a88a8c1
Use getState in DART planning problems.
evil-sherdil Jul 7, 2018
ecb5239
Remove uneeded aikido::'s in ConfigurationToConfiguration_to_Configur…
evil-sherdil Jul 7, 2018
0d4be11
Run make format.
evil-sherdil Jul 7, 2018
aa9554e
Respond to all but one of Gilwoo's nits.
evil-sherdil Jul 7, 2018
204cd21
Respond to some more nits.
evil-sherdil Jul 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/aikido/planner/ConfigurationToConfiguration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class ConfigurationToConfiguration : public Problem

protected:
/// Start state.
const statespace::StateSpace::State* mStartState;
statespace::StateSpace::ScopedState mStartState;

/// Goal state.
const statespace::StateSpace::State* mGoalState;
statespace::StateSpace::ScopedState mGoalState;
};

} // namespace planner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ class ConfigurationToConfigurationPlanner
// which is simply ConfigurationToConfiguration.
using SingleProblemPlanner::plan;

/// Constructor
///
/// \param[in] stateSpace State space that this planner associated with.
/// \copydoc Planner::Planner
explicit ConfigurationToConfigurationPlanner(
statespace::ConstStateSpacePtr stateSpace);
statespace::ConstStateSpacePtr stateSpace, common::RNG* rng = nullptr);

/// Solves \c problem returning the result to \c result.
///
Expand Down
10 changes: 9 additions & 1 deletion include/aikido/planner/Planner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ class Planner
/// Constructs from a state space.
///
/// \param[in] stateSpace State space that this planner associated with.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add docstring for rng.

explicit Planner(statespace::ConstStateSpacePtr stateSpace);
/// \param[in] rng RNG that planner uses. If nullptr, a default is created.
explicit Planner(
statespace::ConstStateSpacePtr stateSpace, common::RNG* rng = nullptr);

/// Default destructor.
virtual ~Planner() = default;

/// Returns const state space.
statespace::ConstStateSpacePtr getStateSpace() const;

/// Returns RNG.
common::RNG* getRng();

/// Returns true if this planner can solve \c problem.
virtual bool canSolve(const Problem& problem) const = 0;

Expand All @@ -44,6 +49,9 @@ class Planner
protected:
/// State space associated with this planner.
statespace::ConstStateSpacePtr mStateSpace;

/// RNG the planner uses.
std::unique_ptr<common::RNG> mRng;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're taking in a raw RNG pointer, do we need to store this as a unique_ptr?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could store is as either, since this is hidden from the user. I picked a unique pointer for convenience, since I create a default RNG if one isn't given, and unique pointers handle memory management once the Planner object is destructed (if my understadning of C++ is correct, which it might not be 😅). Otherwise I think we'd need a custom destructor, since we'd malloc a new RNG.

};

/// Base class for planning result of various planning problems.
Expand Down
7 changes: 3 additions & 4 deletions include/aikido/planner/SingleProblemPlanner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ class SingleProblemPlanner : public Planner
public:
using SolvableProblem = ProblemT;

/// Constructor
///
/// \param[in] stateSpace State space associated with this planner.
explicit SingleProblemPlanner(statespace::ConstStateSpacePtr stateSpace);
/// \copydoc Planner::Planner
explicit SingleProblemPlanner(
statespace::ConstStateSpacePtr stateSpace, common::RNG* rng = nullptr);

// Documentation inherited.
bool canSolve(const Problem& problem) const final override;
Expand Down
75 changes: 75 additions & 0 deletions include/aikido/planner/dart/ConfigurationToConfiguration.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#ifndef AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATION_HPP_
#define AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATION_HPP_

#include <dart/dart.hpp>
#include "aikido/constraint/Testable.hpp"
#include "aikido/planner/Problem.hpp"
#include "aikido/statespace/dart/MetaSkeletonStateSpace.hpp"

namespace aikido {
namespace planner {
namespace dart {

/// Planning problem to plan to a single goal configuration.
class ConfigurationToConfiguration : public Problem
{
public:
/// Constructor. Note that this constructor takes the start state from the
/// current state of the passed MetaSkeleton.
///
/// \param[in] stateSpace State space.
/// param[in] metaSkeleton MetaSkeleton that getStartState will return the
/// current state of when called.
/// \param[in] goalState Goal state to plan to.
/// \param[in] constraint Trajectory-wide constraint that must be satisfied.
ConfigurationToConfiguration(
statespace::dart::ConstMetaSkeletonStateSpacePtr stateSpace,
::dart::dynamics::ConstMetaSkeletonPtr metaSkeleton,
const statespace::dart::MetaSkeletonStateSpace::State* goalState,
constraint::ConstTestablePtr constraint = nullptr);

/// Constructor. Note that this constructor sets the start state on
/// construction.
///
/// \param[in] stateSpace State space.
/// \param[in] startState Start state to plan from.
/// \param[in] goalState Goal state to plan to.
/// \param[in] constraint Trajectory-wide constraint that must be satisfied.
ConfigurationToConfiguration(
statespace::dart::ConstMetaSkeletonStateSpacePtr stateSpace,
const statespace::dart::MetaSkeletonStateSpace::State* startState,
const statespace::dart::MetaSkeletonStateSpace::State* goalState,
constraint::ConstTestablePtr constraint = nullptr);

// Documentation inherited.
const std::string& getType() const override;

/// Returns the type of the planning problem.
static const std::string& getStaticType();

/// Returns the start state.
const statespace::dart::MetaSkeletonStateSpace::State* getStartState() const;

/// Returns the goal state.
const statespace::dart::MetaSkeletonStateSpace::State* getGoalState() const;

protected:
/// MetaSkeletonStateSpace. Prevents use of expensive dynamic cast on
/// mStateSpace.
statespace::dart::ConstMetaSkeletonStateSpacePtr mMetaSkeletonStateSpace;

/// MetaSkeleton, if given.
::dart::dynamics::ConstMetaSkeletonPtr mMetaSkeleton;

/// Start state.
statespace::dart::MetaSkeletonStateSpace::ScopedState mStartState;

/// Goal state.
statespace::dart::MetaSkeletonStateSpace::ScopedState mGoalState;
};

} // namespace dart
} // namespace planner
} // namespace aikido

#endif // AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATION_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONPLANNER_HPP_
#define AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONPLANNER_HPP_

#include "aikido/planner/dart/ConfigurationToConfiguration.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 ConfigurationToEndEffectorOffset planning problem.
class ConfigurationToConfigurationPlanner
: public dart::SingleProblemPlanner<ConfigurationToConfigurationPlanner,
ConfigurationToConfiguration>
{
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 ConfigurationToConfiguration.
using SingleProblemPlanner::plan;

/// Constructor
///
/// \param[in] stateSpace State space that this planner associated with.
/// \param[in] metaSkeleton MetaSkeleton to use for planning.
ConfigurationToConfigurationPlanner(
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_CONFIGURATIONTOCONFIGURATIONPLANNER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONTOCONFIGURATIONTOCONFIGURATION_HPP_
#define AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONTOCONFIGURATIONTOCONFIGURATION_HPP_

#include "aikido/planner/ConfigurationToConfigurationPlanner.hpp"
#include "aikido/planner/dart/ConfigurationToConfigurationPlanner.hpp"
#include "aikido/planner/dart/PlannerAdapter.hpp"

namespace aikido {
namespace planner {
namespace dart {

/// Converts a non-DART ConfigurationToConfiguration planner into the DART
/// version.
class ConfigurationToConfiguration_to_ConfigurationToConfiguration
: public PlannerAdapter<planner::ConfigurationToConfigurationPlanner,
planner::dart::ConfigurationToConfigurationPlanner>
{
public:
/// Constructor
///
/// \param[in] planner Non-DART planner to convert.
/// \param[in] metaSkeleton MetaSkeleton for adapted planner to operate on.
ConfigurationToConfiguration_to_ConfigurationToConfiguration(
std::shared_ptr<planner::ConfigurationToConfigurationPlanner> planner,
::dart::dynamics::MetaSkeletonPtr metaSkeleton);

// Documentation inherited.
virtual trajectory::TrajectoryPtr plan(
const planner::dart::ConfigurationToConfiguration& problem,
Planner::Result* result) override;
};

} // namespace dart
} // namespace planner
} // namespace aikido

#endif // AIKIDO_PLANNER_DART_CONFIGURATIONTOCONFIGURATIONTOCONFIGURATIONTOCONFIGURATION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@ namespace aikido {
namespace planner {
namespace dart {

/// Converts a non-DART ConfigurationToConfiguration planner into a DART
/// ConfigurationToTSR planner.
class ConfigurationToConfiguration_to_ConfigurationToTSR
: public PlannerAdapter<ConfigurationToConfigurationPlanner,
: public PlannerAdapter<aikido::planner::
ConfigurationToConfigurationPlanner,
ConfigurationToTSRPlanner>
{
public:
/// Constructor
///
/// \param[in] planner Non-DART ConfigurationToConfigurationPlanner planner to
/// convert.
/// \param[in] metaSkeleton MetaSkeleton for adapted planner to operate on.
ConfigurationToConfiguration_to_ConfigurationToTSR(
std::shared_ptr<ConfigurationToConfigurationPlanner> planner,
std::shared_ptr<aikido::planner::ConfigurationToConfigurationPlanner>
planner,
::dart::dynamics::MetaSkeletonPtr metaSkeleton);

// Documentation inherited.
virtual trajectory::TrajectoryPtr plan(
const ConfigurationToTSR& problem, Planner::Result* result) override;
};
Expand Down
Loading