Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
File size: 2,718 Bytes
9ff4bea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | # DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs
# Based on "crates/build/re_type_definitions/rerun/components/line_strip2d.def.rs".
# You can extend this class by creating a "LineStrip2DExt" class in "line_strip2d_ext.py".
from __future__ import annotations
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
import numpy as np
import numpy.typing as npt
import pyarrow as pa
from attrs import define, field
from .._baseclasses import (
BaseBatch,
ComponentBatchMixin,
ComponentMixin,
)
from .line_strip2d_ext import LineStrip2DExt
__all__ = ["LineStrip2D", "LineStrip2DArrayLike", "LineStrip2DBatch", "LineStrip2DLike"]
@define(init=False)
class LineStrip2D(LineStrip2DExt, ComponentMixin):
r"""
**Component**: A line strip in 2D space.
A line strip is a list of points connected by line segments. It can be used to draw
approximations of smooth curves.
The points will be connected in order, like so:
```text
2------3 5
/ \ /
0----1 \ /
4
```
"""
_BATCH_TYPE = None
def __init__(self: Any, points: LineStrip2DLike) -> None:
"""Create a new instance of the LineStrip2D component."""
# You can define your own __init__ function as a member of LineStrip2DExt in line_strip2d_ext.py
self.__attrs_init__(points=points)
points: list[encodings.Vec2D] = field()
def __len__(self) -> int:
# You can define your own __len__ function as a member of LineStrip2DExt in line_strip2d_ext.py
return len(self.points)
if TYPE_CHECKING:
from .. import encodings
LineStrip2DLike = LineStrip2D | encodings.Vec2DArrayLike | npt.NDArray[np.float32]
"""A type alias for any LineStrip2D-like object."""
else:
LineStrip2DLike = Any
LineStrip2DArrayLike = LineStrip2D | Sequence[LineStrip2DLike] | npt.NDArray[np.float32]
"""A type alias for any LineStrip2D-like array object."""
class LineStrip2DBatch(BaseBatch[LineStrip2DArrayLike], ComponentBatchMixin):
_ARROW_DATATYPE = pa.list_(
pa.field(
"item",
pa.list_(pa.field("item", pa.float32(), nullable=False, metadata={}), 2),
nullable=False,
metadata={},
)
)
_COMPONENT_TYPE: str = "rerun.components.LineStrip2D"
@staticmethod
def _native_to_pa_array(data: LineStrip2DArrayLike, data_type: pa.DataType) -> pa.Array:
return LineStrip2DExt.native_to_pa_array_override(data, data_type)
# This is patched in late to avoid circular dependencies.
LineStrip2D._BATCH_TYPE = LineStrip2DBatch # type: ignore[assignment]
|