"""Update the GREENBOT entry of the personal web site's data/datasets.json for the v2 release. Usage: web_update_json.py Re-runnable: HF sizes are filled for the sequences converted so far. """ import json import sys from pathlib import Path JS = Path(sys.argv[1]) SEQ = Path(sys.argv[2]) raw = JS.read_text() D = json.loads(raw) g = D["greenhouse"] HF = "https://huggingface.co/datasets/MOLAorg/greenbot-dataset" g["hf_url"] = HF g["calibration_v2_url"] = HF + "/tree/main/calibration/v2" g["calibration_report_url"] = HF + "/blob/main/calibration/v2/CALIBRATION_v2.md" g["description"] = ( "The GREENBOT dataset is a multimodal mobile robotics dataset recorded inside a typical Mediterranean greenhouse with " "tomato crops, a challenging environment where GNSS accuracy is degraded by the structure and the crop. A sensorised " "cart carrying a Velodyne VLP-16 LiDAR, an Ouster OS0 LiDAR with IMU and a Bumblebee BB2 stereo camera was moved " "through all the corridors of the greenhouse in nine sequences. Version 2 (2026) provides all sequences as ROS 2 bags " "(MCAP) on Hugging Face with a corrected extrinsic calibration, static transforms and camera calibration; the original " "ROS 1 bags and MRPT rawlogs remain available. It is the first dataset suitable to test SLAM methods in a greenhouse " "environment.") for k in ("ROS 2", "MCAP", "Hugging Face"): if k not in g["keywords"]: g["keywords"].append(k) if "MCAP" not in g["formats"]: g["formats"].insert(0, "MCAP") SENSORS = {"2022-10-05": "Stereo only", "2022-10-26": "LiDARs + IMU"} PARTS = {"2022-10-19": ["2022-10-19_A", "2022-10-19_B"]} for s in g["sequences"]: names = PARTS.get(s["date"], [s["date"]]) hf = [] for n in names: e = {"name": n} d = SEQ / n if (d / "metadata.yaml").exists(): e["size_bytes"] = sum(f.stat().st_size for f in d.glob("*.mcap")) hf.append(e) s["hf"] = hf s["sensors"] = SENSORS.get(s["date"], "All") out = json.dumps(D, indent=1, ensure_ascii=False) + ("\n" if raw.endswith("\n") else "") JS.write_text(out) print({s["date"]: [(h["name"], h.get("size_bytes")) for h in s["hf"]] for s in g["sequences"]})