Skip to content

Env

src.python_motion_planning.utils.environment.env.Env

Bases: ABC

Class for building 2-d workspace of robots.

Parameters:

Name Type Description Default
x_range int

x-axis range of enviroment

required
y_range int

y-axis range of environmet

required
eps float

tolerance for float comparison

1e-06

Examples:

Python Console Session
>>> from python_motion_planning.utils import Env
>>> env = Env(30, 40)
Source code in src\python_motion_planning\utils\environment\env.py
Python
class Env(ABC):
    """
    Class for building 2-d workspace of robots.

    Parameters:
        x_range (int): x-axis range of enviroment
        y_range (int): y-axis range of environmet
        eps (float): tolerance for float comparison

    Examples:
        >>> from python_motion_planning.utils import Env
        >>> env = Env(30, 40)
    """
    def __init__(self, x_range: int, y_range: int, eps: float = 1e-6) -> None:
        # size of environment
        self.x_range = x_range  
        self.y_range = y_range
        self.eps = eps

    @property
    def grid_map(self) -> set:
        return {(i, j) for i in range(self.x_range) for j in range(self.y_range)}

    @abstractmethod
    def init(self) -> None:
        pass