rrt¶
Submodules¶
Classes¶
- class brom_drake.motion_planning.algorithms.rrt.base.BaseRRTPlanner(robot_model_idx: ModelInstanceIndex, plant: MultibodyPlant, scene_graph: SceneGraph, config: BaseRRTPlannerConfig = None)[source]¶
- find_nearest_node(rrt: DiGraph, q_random: ndarray) Tuple[NodeView, int][source]¶
- Description:
This function finds the nearest node in the RRT to the random configuration.
- class brom_drake.motion_planning.algorithms.rrt.base.BaseRRTPlannerConfig(random_seed: int = 23, steering_step_size: float = 0.05, prob_sample_goal: float = 0.25, max_iterations: int = 10000, convergence_threshold: float = 0.001)[source]¶
- class brom_drake.motion_planning.algorithms.rrt.bidirectional.BidirectionalRRTPlanner(robot_model_idx: ModelInstanceIndex, plant: MultibodyPlant, scene_graph: SceneGraph, config: BidirectionalRRTPlannerConfig = None)[source]¶
- add_new_node_to(target_tree: DiGraph, prev_node: NodeView, q_new: ndarray, tree_is_goal: bool)[source]¶
Description¶
This function adds a new node to the RRT.
Arguments¶
- target_tree: nx.DiGraph
The RRT to add the node to.
- q_new: np.ndarray
The new configuration to add to the RRT.
- plan(q_start: ndarray, q_goal: ndarray, collision_check_fcn: Callable[[ndarray], bool] = None) Tuple[DiGraph, int][source]¶
Description¶
This function plans a path from q_start to q_goal using the Bidirectional RRT algorithm.
Returns¶
- nx.DiGraph
The RRT that was created during the planning process.
- int
The index of the goal node in the RRT.
- sample_from_tree(rrt: DiGraph) NodeView[source]¶
Description¶
This function samples a configuration from the RRT.
- sample_nearest_in_tree(rrt: DiGraph, q_random: ndarray) Tuple[NodeView, float][source]¶
Description¶
This function samples a configuration from the RRT.
Arguments¶
- rrt: nx.DiGraph
The RRT to sample from.
- q_random: np.ndarray
The random configuration to sample from the RRT.
Returns¶
- node_view: nx.classes.reportviews.NodeView
A reference to the nearest node in the RRT. Use this to access the node as follows rrt.nodes[node_view].
- distance: float
The distance from the random configuration to the nearest node in the RRT.
- steer(q_current: ndarray, q_target: ndarray) Tuple[ndarray, bool][source]¶
Description¶
This function steers the RRT from the start configuration to the goal configuration.
Arguments¶
- q_current: np.ndarray
The current configuration of the robot that we wish to steer from.
- q_target: np.ndarray
The target configuration of the robot that we wish to steer to.
Returns¶
- q_new: np.ndarray
The new configuration of the robot after steering.
- reached_config: bool
Whether or not we reached the target configuration with our step size or not.
- steer_towards_tree(rrt_start: DiGraph, rrt_goal: DiGraph, current_tree_is_goal: bool, collision_check_fcn: Callable[[ndarray], bool] = None, debug_flag: bool = False) Tuple[DiGraph, bool][source]¶
Description¶
This function steers the RRT from the start configuration to the goal configuration.
Arguments¶
Returns¶
- bool
Whether or not we reached the target configuration with our step size or not.
- class brom_drake.motion_planning.algorithms.rrt.bidirectional.BidirectionalRRTPlannerConfig(convergence_threshold: float = 0.001, max_tree_nodes: int = 100000, probabilities: BiRRTSamplingProbabilities = BiRRTSamplingProbabilities(sample_goal_tree=0.1, sample_opposite_tree=0.1), random_seed: int = 23, steering_step_size: float = 0.1)[source]¶
A dataclass that defines the configuration for a bidirectional RRT planner.
- class brom_drake.motion_planning.algorithms.rrt.bidirectional.BiRRTSamplingProbabilities(sample_goal_tree: float = 0.1, sample_opposite_tree: float = 0.1)[source]¶
A dataclass that defines the sampling probabilities for a bidirectional RRT planner.
- class brom_drake.motion_planning.algorithms.rrt.bidirectional_connect.BidirectionalRRTConnectPlanner(robot_model_idx: ModelInstanceIndex, plant: MultibodyPlant, scene_graph: SceneGraph, config: BidirectionalRRTConnectPlannerConfig = None)[source]¶
- add_new_node_to(target_tree: DiGraph, prev_node: NodeView, q_new: ndarray, tree_is_goal: bool)[source]¶
Description¶
This function adds a new node to the RRT.
Arguments¶
- target_tree: nx.DiGraph
The RRT to add the node to.
- q_new: np.ndarray
The new configuration to add to the RRT.
- connect(nearest_node_view: NodeView, q_target: ndarray, rrt: DiGraph, tree_is_goal: bool, collision_check_fcn: Callable[[ndarray], bool] = None, target_config_already_exists: bool = False) Tuple[ndarray, bool][source]¶
Description¶
This function connects the RRT from the nearest node to the target configuration.
Arguments¶
- target_config_already_exists: bool
Whether or not the target configuration already exists in the combined RRT.
- plan(q_start: ndarray, q_goal: ndarray, collision_check_fcn: Callable[[ndarray], bool] = None) Tuple[DiGraph, int][source]¶
Description¶
This function plans a path from q_start to q_goal using the Bidirectional RRT algorithm.
Returns¶
- nx.DiGraph
The RRT that was created during the planning process.
- int
The index of the goal node in the RRT.
- sample_from_tree(rrt: DiGraph) NodeView[source]¶
Description¶
This function samples a configuration from the RRT.
- sample_nearest_in_tree(rrt: DiGraph, q_random: ndarray) Tuple[NodeView, float][source]¶
Description¶
This function samples a configuration from the RRT.
Arguments¶
- rrt: nx.DiGraph
The RRT to sample from.
- q_random: np.ndarray
The random configuration to sample from the RRT.
Returns¶
- node_view: nx.classes.reportviews.NodeView
A reference to the nearest node in the RRT. Use this to access the node as follows rrt.nodes[node_view].
- distance: float
The distance from the random configuration to the nearest node in the RRT.
- steer(q_current: ndarray, q_target: ndarray) Tuple[ndarray, bool][source]¶
Description¶
This function steers the RRT from the start configuration to the goal configuration.
Arguments¶
- q_current: np.ndarray
The current configuration of the robot that we wish to steer from.
- q_target: np.ndarray
The target configuration of the robot that we wish to steer to.
Returns¶
- q_new: np.ndarray
The new configuration of the robot after steering.
- reached_config: bool
Whether or not we reached the target configuration with our step size or not.
- steer_towards_tree(rrt_start: DiGraph, rrt_goal: DiGraph, current_tree_is_goal: bool, collision_check_fcn: Callable[[ndarray], bool] = None) Tuple[DiGraph, bool][source]¶
Description¶
This function steers the RRT from the start configuration to the goal configuration.
Arguments¶
Returns¶
- bool
Whether or not we reached the target configuration with our step size or not.
- class brom_drake.motion_planning.algorithms.rrt.bidirectional_connect.BidirectionalRRTConnectPlannerConfig(convergence_threshold: float = 0.001, max_tree_nodes: int = 100000, probabilities: BiRRTConnectSamplingProbabilities = BiRRTConnectSamplingProbabilities(sample_goal_tree=0.1, sample_opposite_tree=0.1), random_seed: int = 23, steering_step_size: float = 0.1, debug: bool = False)[source]¶
A dataclass that defines the configuration for a bidirectional RRT planner.
- class brom_drake.motion_planning.algorithms.rrt.bidirectional_connect.BiRRTConnectSamplingProbabilities(sample_goal_tree: float = 0.1, sample_opposite_tree: float = 0.1)[source]¶
A dataclass that defines the sampling probabilities for a bidirectional RRT planner.
- class brom_drake.motion_planning.algorithms.rrt.connect.RRTConnectPlanner(robot_model_idx: ModelInstanceIndex, plant: MultibodyPlant, scene_graph: SceneGraph, config: RRTConnectPlannerConfig = None)[source]¶
- find_nearest_node(rrt: DiGraph, q_random: ndarray) Tuple[NodeView, int][source]¶
- Description:
This function finds the nearest node in the RRT to the random configuration.
Functions¶
(None found)
Variables¶
(None found)