As I understood addGoalState will add a goal state, without clearing previously set goal states. That's understandable. What I need to understand is when computing the Path using simOMPL.compute How does it resolve the path for all of the goal states? And those are my questions:
1)does it solve for goal states one by one, or solve for all goal states at ones (which would be strange since how the " biased toward the goal" factor would be satisfied)?
2)when the path is found, How to check to which goal state this path is? and what if we have more than one goal state that we can plan a path for, then returned path is for which goal states and based on what?
3)is it granted when using simOMPL.compute to solve the task with many goals states that all goal states will be checked for a solution? Then can we check which goal states we were able to plane and which we were not( because not all goal states might be planned I guess )?
This is an example of using simOMPL.addGoalState from pathplanningdemo1
Code: Select all
simOMPL.setGoalState(task,goalConfigs[1])
for i=2,#goalConfigs,1 do
simOMPL.addGoalState(task,goalConfigs[i])
end
local path=nil
local l=999999999999
for i=1,cnt,1 do --is this cnt to solve the whole task multiple times or it is multiple solve for single goal state?
local res,_path=simOMPL.compute(task,4,-1,300) --here to which goal state this path is planned? and what if we have multiple goal states that could be planned as well, then how to get their path?
if res and _path then
local _l=getPathLength(_path)
if _l<l then
l=_l
path=_path
end
end
end
Cheers,