|
From: Guilherme A. S. P. <gpe...@uf...> - 2017-06-05 11:33:17
|
Hi Adrien, I think that what you want is the VFUpstreamCriterionOptimizationObjective, which is a generalization of your function. In fact your function should define the cost to be proportional to inner product between the vector defined by the line and the derivative of the path: http://ompl.kavrakilab.org/VFUpstreamCriterionOptimizationObjective_8h_source.html The VFUpstreamCriterionOptimizationObjective was defined in the context of VFRRT. See the paper here: http://journals.sagepub.com/doi/abs/10.1177/0278364914545812 An example of how to use it with TRRT and RRT* is here: https://github.com/ompl/ompl/blob/master/demos/VFRRT/VectorFieldConservative.cpp RRT* is supposed to give you the best results, but you will going to spend more time. If time is not a hard constraint, I would go with it. I hope this can help. Guilherme Em 05/06/2017 06:08, Adrien BARRAL escreveu: > Hello, > > I am trying to use OMPL to perform path following while avoiding > obstacles. > > I guessed that using TRRT algorithm with an optimization function > which prune solution far of the path I am following would do the job. > > So I create the following optimization function : > > classFollowLineObjective:publicob::StateCostIntegralObjective > { > public: > FollowLineObjective(constob::SpaceInformationPtr&si): > ob::StateCostIntegralObjective(si,true) > { > } > ob::CoststateCost(constob::State*s)const > { > Eigen::VectorXdpt=vectorField(s); > returnob::Cost(hypot(pt[0],pt[1])); > } > }; > Where vectorField return the vector from the state to the line I am following. > I give this optimization objective to my simple setup, and solutions are found. > The solution is shown here :https://ibb.co/cL5QYF > As we can see the obstacle (in black) is avoided, and the path I am trying to follow (in red) is followed by the solutuion (in blue). > But the solution is not realy optimal because when there is no obstacle, the solution is not a "straight line". > I tryied to "simplify" the solution. But when I simplify it, the optimization seems to be ignored. > So how can I make the solution better "follow" my red line ? > Regards, > Adrien BARRAL. > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > ompl-users mailing list > omp...@li... > https://lists.sourceforge.net/lists/listinfo/ompl-users -- Prof. Guilherme A. S. Pereira Departamento de Engenharia Elétrica Universidade Federal de Minas Gerais Tel: +55 31 3409-6687 http://www.ppgee.ufmg.br/~gpereira |