Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
Download player/world_trails.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 986 Bytes
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/world_trails.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/world_trails.py
-
curl -L -o world_trails.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/world_trails.py
986 Bytes
| """portable_preview AC/RC trail rules: adjacent valid samples in the last five seconds.""" | |
| import numpy as np | |
| COLORS = {'left': [255, 145, 45, 230], 'right': [70, 190, 255, 230], | |
| 'head': [133, 155, 170, 230]} | |
| class RollingTrail: | |
| def __init__(self, positions, times): | |
| positions = np.asarray(positions) | |
| self.times = np.asarray(times) | |
| valid = np.isfinite(positions).all(axis=1) | |
| # The original AC starts at end index 2 (frame 0 is not connected). | |
| ends = np.arange(2, len(positions)) | |
| self.ends = ends[valid[ends - 1] & valid[ends]] | |
| self.starts = self.ends - 1 | |
| self.start_times = self.times[self.starts] | |
| self.segments = np.stack([positions[self.starts], positions[self.ends]], axis=1) | |
| def window(self, frame): | |
| begin = np.searchsorted(self.start_times, self.times[frame] - 5, side='left') | |
| end = np.searchsorted(self.ends, frame, side='right') | |
| return self.segments[begin:end] | |