feat: livox replay#2089
Conversation
# Conflicts: # data/.lfs/go2_hongkong_office.db.tar.gz # data/.lfs/go2_short.db.tar.gz
Greptile SummaryThis PR introduces
Confidence Score: 4/5Safe to merge for the replay functionality itself; the native-module CLI-arg exposure bug in native_module.py is a pre-existing concern that was already raised and is not introduced by this PR. The recording and replay paths are well-structured and the individual components (timed_playback, from_odometry, frame-ID resolution) are correct. The one lingering concern is that _native_ignore_fields() causes FastLio2Config's infrastructure fields (cwd, executable, build_command, cli_exclude) to leak into to_cli_args() output, which was flagged in a prior review round. That issue predates this PR's additions and fastlio-replay/memory don't call to_cli_args() at all, so replay functionality is unaffected. Everything new in this PR is sound. dimos/core/native_module.py — the _native_ignore_fields logic interacts with FastLio2Config's redeclared infrastructure fields in a way that was flagged previously and remains unresolved. Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'main' into ivan/feat/livox..." | Re-trigger Greptile |
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| for klass in self.__class__.__mro__: | ||
| if klass is NativeModuleConfig: | ||
| break | ||
| ignore -= set(getattr(klass, "__annotations__", {})) |
There was a problem hiding this comment.
_native_ignore_fields exposes infrastructure fields as binary CLI args
FastLio2Config re-declares cwd, executable, build_command, and cli_exclude in its class body (to set different defaults). Because those names appear in both NativeModuleConfig.model_fields and FastLio2Config.__annotations__, the new logic removes them from ignore_fields. to_cli_args() then appends --executable result/bin/fastlio2_native --cwd cpp --build_command "nix build .#fastlio2_native" --cli_exclude "frozenset({'config', 'mount'})" to the subprocess command, which the binary will likely reject as unrecognised arguments. The old code was safe because ignore_fields retained every NativeModuleConfig field (with only an explicit frame_id carve-out). A targeted fix would add "cwd", "executable", "build_command", "cli_exclude", and "cli_name_override" to FastLio2Config.cli_exclude, or restrict _native_ignore_fields to only strip fields that are not control/infrastructure fields of the base config.
| return self.inverse() | ||
|
|
||
| @classmethod | ||
| def from_odometry(cls, odom: Odometry) -> Transform: # type: ignore[name-defined] |
There was a problem hiding this comment.
What is the type: ignore for? Looks like Odometry and Transform are imported.
| parent_frame = args[0] if args else kwargs.get("parent_frame") | ||
| child_frame = args[1] if len(args) > 1 else kwargs.get("child_frame") |
There was a problem hiding this comment.
This is an odd way of parsing arguments. Just replace *args, **kwargs with what get_transform wants:
parent_frame: str,
child_frame: str,
time_point: float | None = None,
time_tolerance: float | None = None,
| speed: float = 1.0 | ||
|
|
||
|
|
||
| class FastlioReplay(MemoryModule): |
There was a problem hiding this comment.
This file, fastlio_blueprints, implies it's just for blueprints. Move these new modules to fastlio_modules.py or similar.
|
Looks good. Added some small comments. But I'm not sure how this works with @leshy 's replay stuff: #1976 For example, instead of using different blueprints to record: dimos run mid360-fastlio-memory #to record sample
dimos run mid360-fastlio-replay #to play backThat uses the same blueprint with some arguments. # 1) Start a stack and record all configured output streams
dimos --record-path /tmp/recording.db run unitree-go2
# 2) Stop the run, then replay the same file
dimos --replay-file /tmp/recording.db --viewer rerun-web run unitree-go2 |
yeah this is temporary before replay stuff is mature |
Problem
Replay recorded livox mid360 for offline and reproducible testing
Closes DIM-XXX
Solution
Introduce
FastLioReplayblueprint. Can be dropped in place ofFastLioto play back recorded data.How to Test
dimos run mid360-fastlio-memoryto record sampledimos run mid360-fastlio-replayto play backContributor License Agreement