manifest
Browse files- README.md +4 -4
- generator/g3.py +32 -0
- manifest.csv +0 -0
README.md
CHANGED
|
@@ -12,13 +12,13 @@ rooms, a large warehouse and a forest, with a wide-angle camera of varying field
|
|
| 12 |
Every flight is a native **viobench episode zip** (640x480 RGB PNG at 20 Hz, 200 Hz IMU, ground truth, EuRoC/ASL layout),
|
| 13 |
so `viobench evaluate solution.wasm raw/val/...zip` and `viobench.tools.datasets.read_episode` work on it directly.
|
| 14 |
|
| 15 |
-
Generation and upload in progress (
|
| 16 |
|
| 17 |
| split | room | warehouse | forest |
|
| 18 |
|---|---|---|---|
|
| 19 |
-
| train |
|
| 20 |
-
| val |
|
| 21 |
-
| test |
|
| 22 |
|
| 23 |
|
| 24 |
## What varies per flight (all recorded in `manifest.csv` and in each episode's `episode.json`)
|
|
|
|
| 12 |
Every flight is a native **viobench episode zip** (640x480 RGB PNG at 20 Hz, 200 Hz IMU, ground truth, EuRoC/ASL layout),
|
| 13 |
so `viobench evaluate solution.wasm raw/val/...zip` and `viobench.tools.datasets.read_episode` work on it directly.
|
| 14 |
|
| 15 |
+
Generation and upload in progress (823 flights so far); this table updates as flights land.
|
| 16 |
|
| 17 |
| split | room | warehouse | forest |
|
| 18 |
|---|---|---|---|
|
| 19 |
+
| train | 66 | 31 | 43 |
|
| 20 |
+
| val | 178 | 88 | 92 |
|
| 21 |
+
| test | 161 | 73 | 91 |
|
| 22 |
|
| 23 |
|
| 24 |
## What varies per flight (all recorded in `manifest.csv` and in each episode's `episode.json`)
|
generator/g3.py
CHANGED
|
@@ -68,11 +68,43 @@ def mini(ep,path):
|
|
| 68 |
g=cv2.cvtColor(np.asarray(ep.frames[i]),cv2.COLOR_RGB2GRAY);b=cv2.imencode('.jpg',cv2.resize(g,(320,240),interpolation=cv2.INTER_AREA),[cv2.IMWRITE_JPEG_QUALITY,95])[1].tobytes();buf.append(b);off.append(off[-1]+len(b))
|
| 69 |
npy=lambda a:(lambda f:(np.save(f,a),f.getvalue())[1])(io.BytesIO())
|
| 70 |
return {'.imu.npy':npy(np.asarray(ep.imu)),'.gt.npy':npy(np.asarray(ep.ground_truth)),'.frame_times.npy':npy(np.asarray(ep.frame_times)),'.jpg_offsets.npy':npy(np.array(off)),'.jpg.bin':b''.join(buf)},np.stack([cv2.cvtColor(np.asarray(ep.frames[i]),cv2.COLOR_RGB2GRAY) for i in range(0,len(ep.frames),60)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
def one(f,out):
|
| 72 |
set_template(f['task_overrides'])
|
| 73 |
kl=S.SimConfig
|
| 74 |
if f.get('regime')=='independent-yaw':
|
| 75 |
from robust_sim import IndependentYaw as kl
|
|
|
|
| 76 |
sim=kl(instances=1,duration_seconds=f['seconds'],hold_seconds=f['hold_seconds'],waypoints=48,fov=105.,fov_range=30.)
|
| 77 |
ep,=S.simulate(sim,ref(f),1,seed=f['seed'],camera=camera_for(f),name=f['setting_class'],log=lambda m:None)
|
| 78 |
bs=float(_LAST['p'][0]['render']['brightness_scale']);ep.check_consistency()
|
|
|
|
| 68 |
g=cv2.cvtColor(np.asarray(ep.frames[i]),cv2.COLOR_RGB2GRAY);b=cv2.imencode('.jpg',cv2.resize(g,(320,240),interpolation=cv2.INTER_AREA),[cv2.IMWRITE_JPEG_QUALITY,95])[1].tobytes();buf.append(b);off.append(off[-1]+len(b))
|
| 69 |
npy=lambda a:(lambda f:(np.save(f,a),f.getvalue())[1])(io.BytesIO())
|
| 70 |
return {'.imu.npy':npy(np.asarray(ep.imu)),'.gt.npy':npy(np.asarray(ep.ground_truth)),'.frame_times.npy':npy(np.asarray(ep.frame_times)),'.jpg_offsets.npy':npy(np.array(off)),'.jpg.bin':b''.join(buf)},np.stack([cv2.cvtColor(np.asarray(ep.frames[i]),cv2.COLOR_RGB2GRAY) for i in range(0,len(ep.frames),60)])
|
| 71 |
+
|
| 72 |
+
FY=dict(AMIN=0.2,AMAX=1.2,WMIN=0.2,WMAX=0.9)
|
| 73 |
+
def free_yaw_class():
|
| 74 |
+
import re,hyperlux
|
| 75 |
+
from hashlib import sha256
|
| 76 |
+
class FreeYaw(S.SimConfig):
|
| 77 |
+
"""Camera heading decoupled from travel: yaw = route_yaw + offset + A sin(w t + phase); offset, A, w, phase are drawn per flight
|
| 78 |
+
from a hash of its random route (no recompile per value). Pace is not slowed by heading misalignment."""
|
| 79 |
+
def render_header(self,imu_rate_hz):
|
| 80 |
+
base=super().render_header(imu_rate_hz)
|
| 81 |
+
hd=Path(hyperlux.__file__).parent/"_vendor/rl-tools/include/rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization"
|
| 82 |
+
text=(hd/"tracking_operations_cpu.h").read_text()
|
| 83 |
+
desired="const T desired_yaw = math::atan2(device.math, forward[1], forward[0]);";pace="pace *= alignment * alignment;"
|
| 84 |
+
assert text.count(desired)==1 and text.count(pace)==1
|
| 85 |
+
W=lambda i,j:f"instance_parameters.waypoints[{i}][{j}]"
|
| 86 |
+
H=lambda a,b,c:f"([&](){{ const T x_ = math::sin(device.math, (T){a}*{W(2,0)} + (T){b}*{W(2,1)} + (T){c}*{W(3,0)}) * (T)43758.5453; return x_ - math::floor(device.math, x_); }}())"
|
| 87 |
+
text=text.replace(desired,f"""const T route_yaw = math::atan2(device.math, {W(1,1)} - {W(0,1)}, {W(1,0)} - {W(0,0)});
|
| 88 |
+
const T fy_off = (T)6.28318530718 * {H(12.9898,78.233,37.719)};
|
| 89 |
+
const T fy_amp = (T){FY['AMIN']} + (T){FY['AMAX']-FY['AMIN']} * {H(39.346,11.135,83.155)};
|
| 90 |
+
const T fy_w = (T){FY['WMIN']} + (T){FY['WMAX']-FY['WMIN']} * {H(73.156,52.235,9.151)};
|
| 91 |
+
const T fy_ph = (T)6.28318530718 * {H(27.191,61.371,45.827)};
|
| 92 |
+
const T elapsed = (T)world.task_step * dt;
|
| 93 |
+
const T desired_yaw = route_yaw + fy_off + fy_amp * math::sin(device.math, fy_w * elapsed + fy_ph);""")
|
| 94 |
+
text=text.replace(pace,"(void)alignment;")
|
| 95 |
+
text=re.sub(r'#include "([^"]+)"',lambda m:f'#include "{(hd/m[1]).resolve()}"',text)
|
| 96 |
+
orig="#include <rl_tools/rl/environments/hyperdrone/tasks/visual_inertial_localization/operations_cpu.h>"
|
| 97 |
+
b=base.read_text();assert b.count(orig)==1;spec=b.replace(orig,text+"\n"+orig)
|
| 98 |
+
out=base.parent/f"free-yaw-{sha256(spec.encode()).hexdigest()[:12]}.h"
|
| 99 |
+
if not out.exists(): p=out.with_name(out.name+f".{os.getpid()}.partial");p.write_text(spec);p.replace(out)
|
| 100 |
+
return out
|
| 101 |
+
return FreeYaw
|
| 102 |
def one(f,out):
|
| 103 |
set_template(f['task_overrides'])
|
| 104 |
kl=S.SimConfig
|
| 105 |
if f.get('regime')=='independent-yaw':
|
| 106 |
from robust_sim import IndependentYaw as kl
|
| 107 |
+
elif f.get('regime')=='free-yaw': kl=free_yaw_class()
|
| 108 |
sim=kl(instances=1,duration_seconds=f['seconds'],hold_seconds=f['hold_seconds'],waypoints=48,fov=105.,fov_range=30.)
|
| 109 |
ep,=S.simulate(sim,ref(f),1,seed=f['seed'],camera=camera_for(f),name=f['setting_class'],log=lambda m:None)
|
| 110 |
bs=float(_LAST['p'][0]['render']['brightness_scale']);ep.check_consistency()
|
manifest.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|