Skip to content

Types

Geometry

Represents a 6D pose in SE(3) - position and orientation. Orientation is stored as a 3x3 rotation matrix.

Create SE3Pose from 4x4 homogeneous transformation matrix.

Source code in nav_planning/types/geometry.py
@classmethod
def from_matrix(cls, matrix: np.ndarray) -> "SE3Pose":
    """Create SE3Pose from 4x4 homogeneous transformation matrix."""
    matrix = np.asarray(matrix)
    if matrix.shape != (4, 4):
        raise ValueError(f"Matrix must be shape (4, 4), got {matrix.shape}")
    return cls(position=matrix[:3, 3], rotation=matrix[:3, :3])

Create SE3Pose from position and quaternion (w, x, y, z).

Source code in nav_planning/types/geometry.py
@classmethod
def from_position_quat(
    cls, position: np.ndarray, quaternion: np.ndarray
) -> "SE3Pose":
    """Create SE3Pose from position and quaternion (w, x, y, z)."""
    position = np.asarray(position)
    quaternion = np.asarray(quaternion)
    rotation = quaternion_to_matrix(quaternion)
    return cls(position=position, rotation=rotation)

Create SE3Pose from position and roll-pitch-yaw angles.

Source code in nav_planning/types/geometry.py
@classmethod
def from_position_rpy(
    cls, position: np.ndarray, roll: float, pitch: float, yaw: float
) -> "SE3Pose":
    """Create SE3Pose from position and roll-pitch-yaw angles."""
    from nav_planning.utils.rot_utils import rpy_to_matrix

    position = np.asarray(position)
    rotation = rpy_to_matrix(roll, pitch, yaw)
    return cls(position=position, rotation=rotation)

Convert to 4x4 homogeneous transformation matrix.

Source code in nav_planning/types/geometry.py
def to_matrix(self) -> np.ndarray:
    """Convert to 4x4 homogeneous transformation matrix."""
    matrix = np.eye(4)
    matrix[:3, :3] = self.rotation
    matrix[:3, 3] = self.position
    return matrix

Convert rotation to quaternion (w, x, y, z).

Source code in nav_planning/types/geometry.py
def to_quaternion(self) -> np.ndarray:
    """Convert rotation to quaternion (w, x, y, z)."""
    return matrix_to_quaternion(self.rotation)

Convert rotation to roll-pitch-yaw angles.

Source code in nav_planning/types/geometry.py
def to_rpy(self) -> tuple[float, float, float]:
    """Convert rotation to roll-pitch-yaw angles."""
    from nav_planning.utils.rot_utils import matrix_to_rpy

    return matrix_to_rpy(self.rotation)

Planning

Bases: Enum

Status of a motion planning attempt.

Configuration parameters for the motion planner.

Result of a motion planning attempt.

Parameters for :meth:~nav_planning.planning.MotionPlanner.plan_kinodynamic.

The planner is FLASK (flatness-based kinodynamic RRT-Connect). Joint and base limits default to the robot values in :mod:nav_planning.locobot / :mod:nav_planning.ridgeback; velocity_scale / acceleration_scale shrink or grow all of them at once.

Result of a kinodynamic planning attempt.

On success trajectory is a :class:~nav_planning.trajectory.KinodynamicTrajectory — already time-parameterised, so no separate time-parameterisation step is needed.

Robot