Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mobile platform planning and notebook #5

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion airo_planner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,23 @@
convert_dual_arm_path_chooser_to_single_arm,
)

from airo_planner.interfaces import DualArmPlanner, SingleArmPlanner
from airo_planner.interfaces import DualArmPlanner, SingleArmPlanner, MobilePlatformPlanner

from airo_planner.ompl.single_arm_ompl_planner import SingleArmOmplPlanner
from airo_planner.ompl.dual_arm_ompl_planner import DualArmOmplPlanner
from airo_planner.ompl.mobile_platform_ompl_planner import MobilePlatformOmplPlanner


__all__ = [
"SingleArmPlanner",
"DualArmPlanner",
"MobilePlatformPlanner",
"MultipleGoalPlanner",
"JointConfigurationsModifierType",
"JointPathChooserType",
"SingleArmOmplPlanner",
"DualArmOmplPlanner",
"MobilePlatformOmplPlanner",
"JointBoundsType",
"is_within_bounds",
"uniform_symmetric_joint_bounds",
Expand Down
24 changes: 12 additions & 12 deletions airo_planner/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SingleArmPlanner(abc.ABC):
"""

def plan_to_joint_configuration(
self, start_configuration: JointConfigurationType, goal_configuration: JointConfigurationType
self, start_configuration: JointConfigurationType, goal_configuration: JointConfigurationType
) -> JointPathType:
"""Plan a path from a start configuration to a goal configuration.

Expand All @@ -62,7 +62,7 @@ def plan_to_joint_configuration(
raise NotImplementedError("This planner has not implemented planning to joint configurations (yet).")

def plan_to_tcp_pose(
self, start_configuration: JointConfigurationType, tcp_pose: HomogeneousMatrixType
self, start_configuration: JointConfigurationType, tcp_pose: HomogeneousMatrixType
) -> JointPathType:
raise NotImplementedError("This planner has not implemented planning to TCP poses (yet).")

Expand All @@ -76,11 +76,11 @@ class DualArmPlanner(abc.ABC):
"""

def plan_to_joint_configuration(
self,
start_configuration_left: JointConfigurationType,
start_configuration_right: JointConfigurationType,
goal_configuration_left: JointConfigurationType | None,
goal_configuration_right: JointConfigurationType | None,
self,
start_configuration_left: JointConfigurationType,
start_configuration_right: JointConfigurationType,
goal_configuration_left: JointConfigurationType | None,
goal_configuration_right: JointConfigurationType | None,
) -> JointPathType:
"""Plan a path from a start configurations to a goal configurations.

Expand Down Expand Up @@ -110,10 +110,10 @@ def plan_to_joint_configuration(
raise NotImplementedError("This planner has not implemented planning to joint configurations (yet).")

def plan_to_tcp_pose(
self,
start_configuration_left: JointConfigurationType,
start_configuration_right: JointConfigurationType,
tcp_pose_left: HomogeneousMatrixType | None,
tcp_pose_right: HomogeneousMatrixType | None,
self,
start_configuration_left: JointConfigurationType,
start_configuration_right: JointConfigurationType,
tcp_pose_left: HomogeneousMatrixType | None,
tcp_pose_right: HomogeneousMatrixType | None,
) -> JointPathType:
raise NotImplementedError("This planner has not implemented planning to TCP poses (yet).")
12 changes: 5 additions & 7 deletions airo_planner/ompl/mobile_platform_ompl_planner.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from airo_typing import Vector3DType, JointPathType, JointConfigurationCheckerType
from airo_typing import JointConfigurationCheckerType, JointPathType, Vector3DType
from loguru import logger

from airo_planner import create_simple_setup, state_to_ompl, NoPathFoundError, solve_and_smooth_path
from airo_planner import NoPathFoundError, create_simple_setup, solve_and_smooth_path, state_to_ompl
from airo_planner.interfaces import MobilePlatformPlanner


Expand All @@ -17,13 +17,11 @@ class MobilePlatformOmplPlanner(MobilePlatformPlanner):
"""

def __init__(self, is_state_valid_fn: JointConfigurationCheckerType):
# TODO: JointConfigurationCheckerType is not ideal here, should be a new type.
# TODO: JointConfigurationCheckerType is not ideal here, should be a new type or rename this type?
self.is_state_valid_fn = is_state_valid_fn

joint_bounds = (
np.full(3, -np.inf),
np.full(3, np.inf),
)
# TODO: Allow user to set these bounds.
joint_bounds = (np.array([-10.0, -10.0, -4 * np.pi]), np.array([10.0, 10.0, 4 * np.pi]))
self._simple_setup = create_simple_setup(self.is_state_valid_fn, joint_bounds)

def plan_to_pose(self, start_pose: Vector3DType, goal_pose: Vector3DType) -> JointPathType:
Expand Down
Loading
Loading