Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to load a saved map for replay? #139

Open
genkv opened this issue Aug 20, 2024 · 1 comment
Open

Is it possible to load a saved map for replay? #139

genkv opened this issue Aug 20, 2024 · 1 comment

Comments

@genkv
Copy link

genkv commented Aug 20, 2024

Hi, I run into this scenario when I have SLAM-ed and saved a map. Then, a couple other recordings are completed in the same environment of the map using recording only mode. In order to make every session's coordinate consistent, I want to load the same map for each replay of the recording.

Similar to the code here:

config.mapLoadPath = args.mapLoadPath

I used this config for replay:

config = {
            "useSlam": True,
            "mapLoadPath": map_save_path,
            "fixedMap": True
        }

replay = spectacularAI.Replay(str(video_dir), configuration=config)
replay.setOutputCallback(onOutput)
replay.runReplay()

But the callback function onOutput was never called. If I choose not to use this config, the replay will generate poses for each recording. So I was just wondering if this is possible?

@kaatrasa
Copy link
Member

Hey!

With Replay API, the best approach is to use relocalization parameter set, and I just updated the examples to use it also. Basically, with Replay API, just add

configInternal["mapLoadPath"] = args.mapLoadPath 
configInternal["extendParameterSets"] = ["relocalization"]

Note that the SLAM map relocalization mode is still somewhat experimental and might not be able to reliably relocalize in all environments. For your use case, I would consider using April Tags instead: https://github.com/SpectacularAI/sdk-examples/blob/main/python/oak/april_tag.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants