8 #ifndef BASEOPTIMIZATION_HPP_
9 #define BASEOPTIMIZATION_HPP_
13 #include "API/Trajectory/trajectory.hpp"
15 extern std::vector< std::pair<double,double> > traj_convergence_with_time;
119 std::vector<confPtr_t>
get2RandomConf(
double step,
double& secondDist,
double& firstDist);
139 double interpolateOneDoF(
unsigned int ithActiveDoF ,
double init ,
double goal ,
double alpha );
179 std::string m_ContextName;
180 std::vector<double> m_Selected;
182 int m_nbReallyBiased;
184 double m_currentCost;
191 std::vector< std::pair<double,std::vector<confPtr_t> > > m_convergence_trajs;
192 std::vector< std::pair<double,TrajectoryStatistics> > m_convergence_rate;
193 std::vector<double> m_OptimCost;
194 std::vector<double> m_GainCost;
197 bool m_IterationSucceded;
198 std::vector<double> m_GainOfIterations;
199 unsigned int m_MaxNumberOfIterations;
202 std::vector<uint> m_IdSorted;
203 bool m_ShortCutBiased;
bool partialShortcut()
PatialShortCut : intependently shortcut each DoFs.
Definition: smoothing.cpp:232
void setSortedIndex()
Set the sorted indexes by cost.
Definition: smoothing.cpp:723
void debugShowTraj(double lPrev, double lNext)
Show the trajectory while being deformed.
Definition: smoothing.cpp:525
void computeStats()
compute the stats
Definition: smoothing.cpp:881
void changeIthActiveDofValueOnConf(Configuration &q, unsigned int ithActiveDoF, double value)
Change the Ith Active Dof on Conf.
Definition: smoothing.cpp:419
Smoothing()
Class constructors and destructors.
Definition: smoothing.cpp:31
void removeRedundantNodes()
Go through all nodes in a deterministic manner.
Definition: smoothing.cpp:453
void setRunId(int id)
Set the run Id.
Definition: smoothing.hpp:43
int getIteration()
Get iteration.
Definition: smoothing.hpp:63
int removeUselessNodes()
Deterministic shortcut.
Definition: smoothing.cpp:1055
std::vector< confPtr_t > get2RandomConf(double step, double &secondDist, double &firstDist)
gets randomly two random configurations
Definition: smoothing.cpp:635
double gainOfLastIterations(unsigned int n)
Compute the gain of the last n succueded iterations.
Definition: smoothing.cpp:855
bool oneLoopShortCut()
One loop of the random shortcut.
Definition: smoothing.cpp:86
Definition: smoothing.hpp:23
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
void setStep(double step)
Set a fixed deformation step.
Definition: smoothing.cpp:72
void runShortCut(int nbIteration, int idRun=0)
Runs the shortcut method for a certain number of iterations.
Definition: smoothing.cpp:961
void saveOptimToFile(std::string str)
Save the optimization to a file.
Definition: smoothing.cpp:921
Definition: trajectory.hpp:40
bool isLowerCostLargePortion(double lFirst, double lSecond, std::vector< LocalPath * > &paths)
Compute the subportion of with entire outer localpaths.
Definition: smoothing.cpp:335
double getBiasedParamOnTraj()
Get a parameter on the trajectory which is biased to the high cost parts of the trajectory.
Definition: smoothing.cpp:752
void resetStep()
Use automatic step computation.
Definition: smoothing.cpp:78
void storeCostAndGain(double NewCost, double CurCost)
Store the cost and gain of the iteration in double vectors.
Definition: smoothing.cpp:896
Classe représentant une Configuration d'un Robot.
Definition: configuration.hpp:25
int getRunId()
Get the run Id.
Definition: smoothing.hpp:38
double closestResolutionToStep(double length, double step)
Compute the resolution of a path.
Definition: smoothing.cpp:577
std::vector< confPtr_t > getConfAtStepAlongTraj(double step, double firstDist, double secondDist)
gets randomly n configurations on the traj between firstDist and secondDist
Definition: smoothing.cpp:593
confPtr_t getRandConfAlongTraj(double &randDist, bool use_bias)
Get a random confiruation along the trajectroy that can be biased.
Definition: smoothing.cpp:778
double interpolateOneDoF(unsigned int ithActiveDoF, double init, double goal, double alpha)
Interpolates a Configuration.
Definition: smoothing.cpp:380
double getTime()
Get the time spent in optimization.
Definition: smoothing.hpp:58
void setContextName(std::string name)
Set Context name.
Definition: smoothing.hpp:68
bool oneLoopShortCutRecompute()
One loop of the random shortcut with recomputation of the trajectory cost.
Definition: smoothing.cpp:144
bool checkStopConditions(unsigned int iter)
stops the trajectory optimization
Definition: smoothing.cpp:797