def setOptions(**opts): """Sets a numeric or string-valued setting for the next constructed planner. Arguments are specified by key-value pair. Valid keys are: * "knn": k value for the k-nearest neighbor connection strategy (used in PRM) * "connectionThreshold": a milestone connection threshold * "perturbationRadius": (for RRT and SBL) * "bidirectional": 1 if bidirectional planning is requested (used in RRT) * "grid": 1 if a point selection grid should be used (used in SBL) * "gridResolution": resolution for the grid, if the grid should be used (used in SBL with grid, FMM, FMM*) * "suboptimalityFactor": allowable suboptimality (used in RRT*, lazy PRM*, lazy RRG*) * "randomizeFrequency": a grid randomization frequency (for SBL) * "shortcut": nonzero if you wish to perform shortcutting to improve a path after a first plan is found. * "restart": nonzero if you wish to restart the planner to get progressively better paths with the remaining time. * "pointLocation": a string designating a point location data structure. "kdtree" is supported, optionally followed by a weight vector (used in PRM, RRT*, PRM*, LazyPRM*, LazyRRG*) * "restartTermCond": used if the "restart" setting is true. This is a JSON string defining the termination condition (default value: "{foundSolution:1;maxIters:1000}") (this list may be out-of-date; the most current documentation is listed in Klampt/Python/klampt/src/motionplanning.h) An exception may be thrown if an invalid setting is chosen. """ for (a,b) in opts.items(): if a=='type': motionplanning.setPlanType(str(b)) elif isinstance(b,str): motionplanning.setPlanSetting(a,b) else: motionplanning.setPlanSetting(a,float(b))
def setOptions(**opts): """Sets a numeric or string-valued setting for the next constructed planner. Arguments are specified by key-value pair. Valid keys are: * "knn": k value for the k-nearest neighbor connection strategy (used in PRM) * "connectionThreshold": a milestone connection threshold * "perturbationRadius": (for RRT and SBL) * "bidirectional": 1 if bidirectional planning is requested (used in RRT) * "grid": 1 if a point selection grid should be used (used in SBL) * "gridResolution": resolution for the grid, if the grid should be used (used in SBL with grid, FMM, FMM*) * "suboptimalityFactor": allowable suboptimality (used in RRT*, lazy PRM*, lazy RRG*) * "randomizeFrequency": a grid randomization frequency (for SBL) * "shortcut": nonzero if you wish to perform shortcutting to improve a path after a first plan is found. * "restart": nonzero if you wish to restart the planner to get progressively better paths with the remaining time. * "pointLocation": a string designating a point location data structure. "kdtree" is supported, optionally followed by a weight vector (used in PRM, RRT, RRT*, PRM*, LazyPRM*, LazyRRG*) * "restartTermCond": used if the "restart" setting is true. This is a JSON string defining the termination condition (default value: "{foundSolution:1;maxIters:1000}") (this list may be out-of-date; the most current documentation is listed in Klampt/Python/klampt/src/motionplanning.h) An exception may be thrown if an invalid setting is chosen. """ for (a, b) in opts.items(): if a == 'type': motionplanning.setPlanType(str(b)) elif isinstance(b, str): motionplanning.setPlanSetting(a, b) else: motionplanning.setPlanSetting(a, float(b))
def setOptions(**opts): for (a, b) in opts.items(): if a == "type": motionplanning.setPlanType(str(b)) else: motionplanning.setPlanSetting(a, float(b))