Datasets:
Download code/evaluation-code/v0.2-0c2690ae/tests/pipeline/test_gen_avoid.py from VEHwang/cocogni4d: direct link, hf CLI and curl.
- Browser
- Download file 677 Bytes
-
https://huggingface.co/datasets/VEHwang/cocogni4d/resolve/main/code/evaluation-code/v0.2-0c2690ae/tests/pipeline/test_gen_avoid.py
- Command line
-
hf download hf://datasets/VEHwang/cocogni4d/code/evaluation-code/v0.2-0c2690ae/tests/pipeline/test_gen_avoid.py
-
curl -L -o test_gen_avoid.py https://huggingface.co/datasets/VEHwang/cocogni4d/resolve/main/code/evaluation-code/v0.2-0c2690ae/tests/pipeline/test_gen_avoid.py
677 Bytes
| """Swept collision checks retain a crossing failure and a clear-path control.""" | |
| import unittest | |
| import numpy as np | |
| from embodied_pipeline.gen import avoid | |
| class Walls(unittest.TestCase): | |
| CELL = .025 | |
| def test_sweep_catches_crossing_between_safe_ends(self): | |
| ok = np.ones((120, 240), bool) | |
| ok[:80, 118:122] = False | |
| self.assertTrue(ok[int(1/self.CELL), int(2.8/self.CELL)] and ok[int(1/self.CELL), int(3.2/self.CELL)]) | |
| self.assertFalse(avoid.sweep_ok(ok, (0., 0.), self.CELL, (2.8, 1.), (3.2, 1.))) | |
| self.assertTrue(avoid.sweep_ok(ok, (0., 0.), self.CELL, (2.8, 2.5), (3.2, 2.5))) | |
| if __name__ == "__main__": | |
| unittest.main() | |