Skip to content

Commit

Permalink
remove determinism experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorlouisdg committed Mar 19, 2024
1 parent a9db589 commit e798c8f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 118 deletions.
10 changes: 0 additions & 10 deletions airo_planner/ompl/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ def bounds_to_ompl(joint_bounds: JointBoundsType) -> ob.RealVectorBounds:
return bounds


def allocDeterministicStateSampler(space: ob.StateSpace) -> ob.StateSampler:
from loguru import logger

logger.info("Allocating RealVectorDeterministicStateSampler")
return ob.RealVectorDeterministicStateSampler(space)


def create_simple_setup(
is_state_valid_fn: JointConfigurationCheckerType, joint_bounds: JointBoundsType
) -> og.SimpleSetup:
Expand All @@ -72,9 +65,6 @@ def create_simple_setup(

is_state_valid_ompl = function_to_ompl(is_state_valid_fn, degrees_of_freedom)

space.setStateSamplerAllocator(ob.StateSamplerAllocator(allocDeterministicStateSampler))
# space.allocStateSampler()

# Configure the SimpleSetup object
simple_setup = og.SimpleSetup(space)
simple_setup.setStateValidityChecker(ob.StateValidityCheckerFn(is_state_valid_ompl))
Expand Down
9 changes: 0 additions & 9 deletions notebooks/01_planning_to_joint_configurations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@
"animate_joint_trajectory(scene.meshcat, scene.robot_diagram, scene.arm_index, trajectory)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# planner._simple_setup.getSpaceInformation().ValidStateSamplerAllocator()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
99 changes: 0 additions & 99 deletions notebooks/02_planning_to_tcp_poses.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -291,105 +291,6 @@
"print(f\"\\nLength of path that planner returned: {calculate_joint_path_length(path):.2f}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"valid_sampler = planner._simple_setup.getSpaceInformation().allocValidStateSampler()\n",
"valid_sampler"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from ompl import base as ob\n",
"from ompl import util as ou\n",
"from loguru import logger\n",
"\n",
"class DeterministicValidStateSampler(ob.ValidStateSampler):\n",
" def __init__(self, space_information: ob.SpaceInformation, random_seed: int = 1):\n",
" logger.info(\"Creating DeterministicValidStateSampler\")\n",
" super(DeterministicValidStateSampler, self).__init__(space_information)\n",
" self.rng_ = ou.RNG(random_seed)\n",
"\n",
"\n",
"def allocDeterministicValidStateSampler(space_information: ob.SpaceInformation) -> ob.ValidStateSampler:\n",
" logger.info(\"Allocating DeterministicValidStateSampler\")\n",
" return DeterministicValidStateSampler(space_information)\n",
"\n",
"\n",
"space_information = planner._simple_setup.getSpaceInformation()\n",
"DeterministicValidStateSampler(space_information)\n",
"allocDeterministicValidStateSampler(space_information)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ob.RealVectorDeterministicStateSampler(planner._simple_setup.getStateSpace())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# def allocDeterministicStateSampler(space: ob.StateSpace) -> ob.StateSampler:\n",
"# return ob.RealVectorDeterministicStateSampler(space)\n",
"\n",
"# planner._simple_setup.getStateSpace().setStateSamplerAllocator(ob.StateSamplerAllocator(allocDeterministicStateSampler))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from airo_planner.ompl.utilities import create_simple_setup\n",
"import ompl.geometric as og\n",
"\n",
"planner._simple_setup = create_simple_setup(planner.is_state_valid_fn, planner.joint_bounds)\n",
"# space_information = planner._simple_setup.getSpaceInformation()\n",
"# space_information.clearValidStateSamplerAllocator()\n",
"# space_information.setValidStateSamplerAllocator(ob.ValidStateSamplerAllocator(allocDeterministicValidStateSampler))\n",
"# space_information.allocValidStateSampler()\n",
"\n",
"# rrt_connect = og.RRTConnect(space_information)\n",
"# planner._simple_setup.setPlanner(rrt_connect)\n",
"\n",
"path = planner.plan_to_tcp_pose(start_joints, goal_pose)\n",
"calculate_joint_path_length(path)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"planner._simple_setup = create_simple_setup(planner.is_state_valid_fn, planner.joint_bounds)\n",
"# space_information = planner._simple_setup.getSpaceInformation()\n",
"# space_information.clearValidStateSamplerAllocator()\n",
"# space_information.setValidStateSamplerAllocator(ob.ValidStateSamplerAllocator(allocDeterministicValidStateSampler))\n",
"# space_information.allocValidStateSampler()\n",
"\n",
"# rrt_connect = og.RRTConnect(space_information)\n",
"# planner._simple_setup.setPlanner(rrt_connect)\n",
"\n",
"path = planner.plan_to_tcp_pose(start_joints, goal_pose)\n",
"calculate_joint_path_length(path)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit e798c8f

Please sign in to comment.