Commit 948d263f authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Merge remote-tracking branch 'florent/devel' into devel

parents 3fe3a89e 0992fc0c
......@@ -227,6 +227,7 @@ SET(${PROJECT_NAME}_SOURCES
src/steering-method/car-like.cc
src/steering-method/constant-curvature.cc
src/steering-method/dubins.cc
src/steering-method/serialization.cc
src/steering-method/snibud.cc
src/steering-method/spline.cc
src/steering-method/straight.cc
......
-*- outline -*-
* Serialize several classes for save and loading roadmaps
* use shared pointers to class Problem only. Classes previously storing const
references to Problem now store const weak pointers. Classes that use to
take a const reference to problem in the constructor now take a const
shared pointer.
New in v4.10.0
* Add a parameter to set the center of the Gaussiant configuration shooter.
* Add a parameter to set the center of the Gaussian configuration shooter.
* Fix bug in Reeds and Shepp paths when curvature is not equal to 1.
* Handle LockedJoint and Implicit instances in the same container in ProblemSolver class. make method ProblemSolver::addLockedJointToConfigProjector deprecated.
* Replace class ContinuousCollisionChecking by class ContinuousValidation for broader generalisation.
......
......@@ -34,18 +34,19 @@ namespace hpp {
public:
/// Return shared pointer to new object.
static BiRRTPlannerPtr_t createWithRoadmap
(const Problem& problem, const RoadmapPtr_t& roadmap);
(const ProblemConstPtr_t& problem, const RoadmapPtr_t& roadmap);
/// Return shared pointer to new object.
static BiRRTPlannerPtr_t create (const Problem& problem);
static BiRRTPlannerPtr_t create (const ProblemConstPtr_t& problem);
/// One step of extension.
virtual void startSolve();
/// One step of extension.
virtual void oneStep ();
protected:
/// Constructor
BiRRTPlanner (const Problem& problem, const RoadmapPtr_t& roadmap);
BiRRTPlanner (const ProblemConstPtr_t& problem,
const RoadmapPtr_t& roadmap);
/// Constructor with roadmap
BiRRTPlanner (const Problem& problem);
BiRRTPlanner (const ProblemConstPtr_t& problem);
/// Store weak pointer to itself
void init (const BiRRTPlannerWkPtr_t& weak);
PathPtr_t extendInternal (const SteeringMethodPtr_t& sm, Configuration_t& qProj_, const NodePtr_t& near,
......
......@@ -51,9 +51,6 @@ namespace hpp {
/// Return the number of config validations
size_type numberConfigValidations() const;
// Clear the vector of config validations
void clear ();
protected:
ConfigValidations ();
}; // class ConfigValidation
......
......@@ -32,18 +32,18 @@ namespace hpp {
public:
/// Return shared pointer to new object.
static DiffusingPlannerPtr_t createWithRoadmap
(const Problem& problem, const RoadmapPtr_t& roadmap);
(const ProblemConstPtr_t& problem, const RoadmapPtr_t& roadmap);
/// Return shared pointer to new object.
static DiffusingPlannerPtr_t create (const Problem& problem);
static DiffusingPlannerPtr_t create (const ProblemConstPtr_t& problem);
/// One step of extension.
virtual void oneStep ();
/// Set configuration shooter.
void configurationShooter (const ConfigurationShooterPtr_t& shooter);
protected:
/// Constructor
DiffusingPlanner (const Problem& problem, const RoadmapPtr_t& roadmap);
DiffusingPlanner (const ProblemConstPtr_t& problem, const RoadmapPtr_t& roadmap);
/// Constructor with roadmap
DiffusingPlanner (const Problem& problem);
DiffusingPlanner (const ProblemConstPtr_t& problem);
/// Store weak pointer to itself
void init (const DiffusingPlannerWkPtr_t& weak);
/// Extend a node in the direction of a configuration
......
......@@ -36,15 +36,15 @@ namespace hpp {
{
public:
virtual DistancePtr_t clone () const;
static ReedsSheppPtr_t create (const Problem& problem);
static ReedsSheppPtr_t create (const Problem& problem,
static ReedsSheppPtr_t create (const ProblemConstPtr_t& problem);
static ReedsSheppPtr_t create (const ProblemConstPtr_t& problem,
const value_type& turningRadius,
JointPtr_t xyJoint, JointPtr_t rzJoint);
static ReedsSheppPtr_t createCopy (const ReedsSheppPtr_t& distance);
protected:
ReedsShepp (const Problem& problem);
ReedsShepp (const Problem& problem,
ReedsShepp (const ProblemConstPtr_t& problem);
ReedsShepp (const ProblemConstPtr_t& problem,
const value_type& turningRadius,
JointPtr_t xyJoint, JointPtr_t rzJoint);
ReedsShepp (const ReedsShepp& distance);
......
......@@ -177,6 +177,7 @@ namespace hpp {
typedef boost::shared_ptr <const PathVector> PathVectorConstPtr_t;
typedef boost::shared_ptr <PlanAndOptimize> PlanAndOptimizePtr_t;
typedef boost::shared_ptr <Problem> ProblemPtr_t;
typedef boost::shared_ptr <const Problem> ProblemConstPtr_t;
typedef ProblemSolver* ProblemSolverPtr_t;
typedef boost::shared_ptr <Roadmap> RoadmapPtr_t;
typedef boost::shared_ptr <StraightPath> StraightPathPtr_t;
......
......@@ -37,7 +37,8 @@ namespace core {
class HPP_CORE_DLLAPI KinodynamicDistance : public Distance {
public:
static KinodynamicDistancePtr_t create (const DevicePtr_t& robot);
static KinodynamicDistancePtr_t createFromProblem (const Problem& problem);
static KinodynamicDistancePtr_t createFromProblem
(const ProblemConstPtr_t& problem);
static KinodynamicDistancePtr_t createCopy
(const KinodynamicDistancePtr_t& distance);
......@@ -51,7 +52,7 @@ public:
}
protected:
KinodynamicDistance (const DevicePtr_t& robot);
KinodynamicDistance (const Problem& problem);
KinodynamicDistance (const ProblemConstPtr_t& problem);
KinodynamicDistance (const KinodynamicDistance& distance);
void init (KinodynamicDistanceWkPtr_t self);
/// Derived class should implement this function
......
......@@ -142,6 +142,12 @@ namespace hpp {
}
}
// Clear the vector of config validations
void clear ()
{
validations_.clear ();
}
protected:
typedef Derived value_t;
typedef std::vector<value_t> values_t;
......
......@@ -77,7 +77,11 @@ namespace hpp {
const RoadmapPtr_t& roadmap, ObjectFactory* parent = NULL);
private:
ProblemPtr_t problem_;
ProblemPtr_t problem() const
{
return problem_.lock();
}
ProblemWkPtr_t problem_;
void computePermutation (const std::vector <std::string>& jointNames);
ConfigurationPtr_t permuteAndCreateConfiguration
......
......@@ -61,10 +61,12 @@ namespace hpp {
public:
/// Return shared pointer to new object.
template < typename Traits > static
ConfigOptimizationPtr_t createWithTraits (const Problem& problem);
ConfigOptimizationPtr_t createWithTraits
(const ProblemConstPtr_t& problem);
/// Return shared pointer to new object.
static ConfigOptimizationPtr_t create (const Problem& problem);
static ConfigOptimizationPtr_t create
(const ProblemConstPtr_t& problem);
/// Optimize path
virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
......@@ -92,7 +94,7 @@ namespace hpp {
} parameters;
protected:
ConfigOptimization (const Problem& problem);
ConfigOptimization (const ProblemConstPtr_t& problem);
virtual constraints::ImplicitPtr_t createNumConstraint
(const PathVector& path) const;
......@@ -123,7 +125,7 @@ namespace hpp {
/// \}
template < typename Traits > ConfigOptimizationPtr_t
ConfigOptimization::createWithTraits (const Problem& problem)
ConfigOptimization::createWithTraits (const ProblemConstPtr_t& problem)
{
ConfigOptimization* ptr = new ConfigOptimization (problem);
ptr->parameters.addConfigConstraintToPath =
......
......@@ -37,13 +37,13 @@ namespace hpp {
public:
/// Return shared pointer to new object.
/// Default cost is path length.
static GradientBasedPtr_t create (const Problem& problem);
static GradientBasedPtr_t create (const ProblemConstPtr_t& problem);
/// Optimize path
virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
protected:
GradientBased (const Problem& problem);
GradientBased (const ProblemConstPtr_t& problem);
private:
typedef Eigen::JacobiSVD < matrix_t > Jacobi_t;
......
......@@ -58,10 +58,11 @@ namespace hpp {
public:
/// Return shared pointer to new object.
template < typename Traits > static
PartialShortcutPtr_t createWithTraits (const Problem& problem);
PartialShortcutPtr_t createWithTraits
(const ProblemConstPtr_t& problem);
/// Return shared pointer to new object.
static PartialShortcutPtr_t create (const Problem& problem);
static PartialShortcutPtr_t create (const ProblemConstPtr_t& problem);
/// Optimize path
virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
......@@ -91,7 +92,7 @@ namespace hpp {
} parameters;
protected:
PartialShortcut (const Problem& problem);
PartialShortcut (const ProblemConstPtr_t& problem);
private:
PathVectorPtr_t generatePath (PathVectorPtr_t path, JointConstPtr_t joint,
......@@ -119,7 +120,7 @@ namespace hpp {
/// \}
template < typename Traits > PartialShortcutPtr_t
PartialShortcut::createWithTraits (const Problem& problem)
PartialShortcut::createWithTraits (const ProblemConstPtr_t& problem)
{
PartialShortcut* ptr = new PartialShortcut (problem);
ptr->parameters.removeLockedJoints = Traits::removeLockedJoints();
......
......@@ -39,12 +39,12 @@ namespace hpp {
{
public:
/// Return shared pointer to new object.
static RandomShortcutPtr_t create (const Problem& problem);
static RandomShortcutPtr_t create (const ProblemConstPtr_t& problem);
/// Optimize path
virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
protected:
RandomShortcut (const Problem& problem);
RandomShortcut (const ProblemConstPtr_t& problem);
/// Sample times along currentOpt
/// \param currentOpt the current path
......
......@@ -38,12 +38,12 @@ namespace hpp {
{
public:
/// Return shared pointer to new object.
static SimpleShortcutPtr_t create (const Problem& problem);
static SimpleShortcutPtr_t create (const ProblemConstPtr_t& problem);
/// Optimize path
virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
protected:
SimpleShortcut (const Problem& problem);
SimpleShortcut (const ProblemConstPtr_t& problem);
}; // class SimpleShortcut
/// \}
} // namespace pathOptimization
......
......@@ -176,13 +176,14 @@ namespace hpp {
{
public:
/// Return shared pointer to new object.
static SimpleTimeParameterizationPtr_t create (const Problem& problem);
static SimpleTimeParameterizationPtr_t create
(const ProblemConstPtr_t& problem);
/// Optimize path
virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
protected:
SimpleTimeParameterization (const Problem& problem);
SimpleTimeParameterization (const ProblemConstPtr_t& problem);
}; // class SimpleTimeParameterization
/// \}
} // namespace pathOptimization
......
......@@ -71,7 +71,7 @@ namespace hpp {
protected:
SplineGradientBasedAbstract (const Problem& problem);
SplineGradientBasedAbstract (const ProblemConstPtr_t& problem);
/// \name Spline creation
/// \{
......
......@@ -50,7 +50,7 @@ namespace hpp {
/// Return shared pointer to new object.
/// Default cost is path length.
static Ptr_t create (const Problem& problem);
static Ptr_t create (const ProblemConstPtr_t& problem);
/// Optimize path
/// \li 1) Transform straight paths into splines
......@@ -74,7 +74,7 @@ namespace hpp {
using Base::robot_;
using Base::problem;
SplineGradientBased (const Problem& problem);
SplineGradientBased (const ProblemConstPtr_t& problem);
/// \name Constraint creation
/// \{
......
......@@ -37,7 +37,7 @@ namespace hpp {
virtual ~PathOptimizer () {};
/// Get problem
const Problem& problem () const
ProblemConstPtr_t problem () const
{
return problem_;
}
......@@ -58,7 +58,7 @@ namespace hpp {
/// interrupt.
bool interrupt_;
PathOptimizer (const Problem& problem);
PathOptimizer (const ProblemConstPtr_t& problem);
PathPtr_t steer (ConfigurationIn_t q1, ConfigurationIn_t q2) const;
......@@ -71,7 +71,7 @@ namespace hpp {
void initFromParameters ();
private:
const Problem& problem_;
ProblemConstPtr_t problem_;
/// Maximal number of iterations to solve a problem
/// reaching this bound raises an exception.
......
......@@ -33,12 +33,12 @@ namespace hpp {
/// set of goal configurations.
class HPP_CORE_DLLAPI PathPlanner {
public:
virtual ~PathPlanner () {};
virtual ~PathPlanner ();
/// Get roadmap
virtual const RoadmapPtr_t& roadmap () const;
/// Get problem
const Problem& problem () const;
ProblemConstPtr_t problem () const;
/// Initialize the problem resolution
/// \li Set initial and and goal nodes,
/// \li check problem consistency
......@@ -80,16 +80,17 @@ namespace hpp {
/// Constructor
///
/// Create a new roadmap
PathPlanner (const Problem& problem);
PathPlanner (const ProblemConstPtr_t& problem);
/// Constructor
///
/// Store a given roadmap.
PathPlanner (const Problem& problem, const RoadmapPtr_t& roadmap);
PathPlanner (const ProblemConstPtr_t& problem,
const RoadmapPtr_t& roadmap);
/// Store weak pointer to itself
void init (const PathPlannerWkPtr_t& weak);
private:
/// Reference to the problem
const Problem& problem_;
const ProblemConstWkPtr_t problem_;
/// Pointer to the roadmap.
const RoadmapPtr_t roadmap_;
bool interrupt_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment