irsim.lib.handler.geometry_handler#
Classes#
This class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
This class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
This class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
This class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
This class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
This class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
This class is used to handle the 3D geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object. |
|
Factory class to create geometry handlers. |
Module Contents#
- class irsim.lib.handler.geometry_handler.geometry_handler(name: str, **kwargs)[源代码]#
Bases:
abc.ABCThis class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- name#
- geometry#
- wheelbase#
- abstractmethod construct_original_geometry(**kwargs)[源代码]#
Construct the original geometry of the object when the state is in the origin of coordinates.
- 参数:
**kwargs -- shape parameters
Returns: Geometry of the object
- step(state)[源代码]#
Transform geometry to the new state.
- 参数:
state (np.ndarray) -- State vector [x, y, theta].
- 返回:
Transformed geometry.
- 返回类型:
shapely.geometry.base.BaseGeometry
- get_init_Gh()[源代码]#
Generate initial G and h for convex object.
- 返回:
G matrix: (N, 2)
h vector: (N, 1)
cone_type (str): "norm2" for circle or "Rpositive" for polygon
convex_flag (bool): whether convex constraints are valid
- 返回类型:
tuple[np.ndarray, np.ndarray, str | None, bool | None]
- get_polygon_Gh(vertices: numpy.ndarray | None = None)[源代码]#
Generate G and h for convex polygon.
- 参数:
vertices -- (2, N), N: Edge number of the object
- 返回:
G matrix: (N, 2)
h vector: (N, 1)
cone_type (str): "Rpositive" for polygon
convex_flag (bool): whether convex constraints are valid
- 返回类型:
tuple[np.ndarray | None, np.ndarray | None, str | None, bool]
- get_circle_Gh(center: numpy.ndarray, radius: float)[源代码]#
Generate G and h for circle.
- 参数:
center -- (2, 1) array of center
radius -- float of radius
- 返回:
G matrix: (3, 2)
h vector: (3, 1)
cone_type (str): "norm2"
convex_flag (bool): True
- 返回类型:
tuple[np.ndarray, np.ndarray, str, bool]
- property vertices#
- property init_vertices#
[[x1, y1], [x2, y2].... [[x1, y1]]]; [x1, y1] will repeat twice
- Type:
return original_vertices
- property original_vertices: numpy.ndarray | None#
Get the original vertices of the geometry.
- property original_centroid: numpy.ndarray#
Get the original centroid of the geometry.
- 返回:
The original centroid of the geometry.
- 返回类型:
np.ndarray
- property radius#
- class irsim.lib.handler.geometry_handler.CircleGeometry(name: str = 'circle', **kwargs)[源代码]#
Bases:
geometry_handlerThis class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- construct_original_geometry(radius: float = 0.2, center: list | None = None, random_shape: bool = False, radius_range: list | None = None, wheelbase: float | None = None)[源代码]#
Construct the original geometry of the object when the state is in the origin of coordinates.
- 参数:
**kwargs -- shape parameters
Returns: Geometry of the object
- class irsim.lib.handler.geometry_handler.PolygonGeometry(name: str = 'polygon', **kwargs)[源代码]#
Bases:
geometry_handlerThis class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- construct_original_geometry(vertices=None, random_shape: bool = False, is_convex: bool = False, **kwargs)[源代码]#
Construct a polygon geometry.
- 参数:
vertices -- [[x1, y1], [x2, y2]..]
random_shape -- whether to generate random shape, default is False
is_convex -- whether to generate convex shape, default is False
**kwargs -- see random_generate_polygon()
- 返回:
Polygon object
- class irsim.lib.handler.geometry_handler.RectangleGeometry(name: str = 'rectangle', **kwargs)[源代码]#
Bases:
geometry_handlerThis class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- class irsim.lib.handler.geometry_handler.LinestringGeometry(name: str = 'linestring', **kwargs)[源代码]#
Bases:
geometry_handlerThis class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- construct_original_geometry(vertices, random_shape: bool = False, is_convex: bool = True, **kwargs)[源代码]#
Construct a LineString object.
- 参数:
vertices -- [[x1, y1], [x2, y2]..]
random_shape -- whether to generate random shape, default is False
is_convex -- whether to generate convex shape, default is False
**kwargs -- see random_generate_polygon()
- 返回:
LineString object
- class irsim.lib.handler.geometry_handler.PointsGeometry(name: str = 'map', **kwargs)[源代码]#
Bases:
geometry_handlerThis class is used to handle the geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- class irsim.lib.handler.geometry_handler.geometry_handler3d(name: str, **kwargs)[源代码]#
Bases:
abc.ABCThis class is used to handle the 3D geometry of the object. It reads the shape parameters from yaml file and constructs the geometry of the object.
- name#
- geometry#
- wheelbase#
- class irsim.lib.handler.geometry_handler.GeometryFactory[源代码]#
Factory class to create geometry handlers.
- static create_geometry(name: str = 'circle', **kwargs) geometry_handler[源代码]#