@@ -119,8 +119,9 @@ const goal = new oxmpl.Goal(
119119// Create problem and run planner
120120const problem = new oxmpl.ProblemDefinition (space, start, goal);
121121const validityChecker = new oxmpl.StateValidityChecker (isStateValid);
122+ const planner_config = new oxmpl.PlannerConfig (123 );
122123
123- const planner = new oxmpl.RRT (0.5 , 0.05 );
124+ const planner = new oxmpl.RRT (0.5 , 0.05 , planner_config );
124125planner .setup (problem, validityChecker);
125126
126127try {
@@ -141,7 +142,7 @@ Here is a complete example of solving a 2D planning problem with a custom collis
141142
142143``` python
143144import math
144- from oxmpl_py.base import RealVectorState, RealVectorStateSpace, ProblemDefinition
145+ from oxmpl_py.base import RealVectorState, RealVectorStateSpace, ProblemDefinition, PlannerConfig
145146from oxmpl_py.geometric.planners import RRT
146147
147148def is_state_valid (state : RealVectorState) -> bool :
@@ -167,8 +168,12 @@ start_state = RealVectorState([-5.0, -5.0])
167168goal_region = MyCircularGoal(space, x = 5.0 , y = 5.0 , radius = 0.5 )
168169
169170problem_def = ProblemDefinition.from_real_vector(space, start_state, goal_region)
171+ planner_config = PlannerConfig(seed = 123 )
170172
171- planner = RRT(max_distance = 0.5 , goal_bias = 0.05 , problem_definition = problem_def)
173+ planner = RRT(max_distance = 0.5 ,
174+ goal_bias = 0.05 ,
175+ problem_definition = problem_def,
176+ planner_config = planner_config)
172177planner.setup(is_state_valid)
173178
174179try :
@@ -188,7 +193,7 @@ use std::{f64::consts::PI, sync::Arc, time::Duration};
188193use oxmpl :: base :: {
189194 error :: StateSamplingError ,
190195 goal :: {Goal , GoalRegion , GoalSampleableRegion },
191- planner :: {Path , Planner },
196+ planner :: {Path , Planner , PlannerConfig },
192197 problem_definition :: ProblemDefinition ,
193198 space :: {RealVectorStateSpace , StateSpace },
194199 state :: RealVectorState ,
@@ -288,7 +293,7 @@ fn main() {
288293 wall_thickness : 0.5 ,
289294 });
290295
291- let mut planner = RRT :: new (0.5 , 0.0 );
296+ let mut planner = RRT :: new (0.5 , 0.0 , & PlannerConfig { seed : Some ( 123 ) } );
292297
293298 planner . setup (problem_definition , validity_checker . clone ());
294299
0 commit comments