# Relocalization on a loaded map

Source: https://forum.modalai.com/topic/1871/relocalization-on-a-loaded-map
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-02-24 13:25:39 UTC by afdrus
Replies: 5 · Views: 1126

## afdrus · 2023-02-24 13:25:39 UTC

Hi everyone,

I am doing some pre-flight checks with a Sentinel drone to check how the localization works in the voxl-mapper. I noticed that the drone is not able to relocalize itself within a loaded map that I did earlier. What I did is the following:
 
* I switched on the drone in a specific position and I moved it around to build a 3D map using the stereo input;

* When I was satisfied with the map I saved it and I switched off the drone;

* I moved the drone to another point and I switched it on;

* I loaded the 3D map that I made in the previous powercycle and I moved around the drone to see whether it was able to relocalize itself in the map or not.

Despite the map was updating while I was moving around, the drone was not relocalizing itself and it ended up creating a "false" map of the environment.
Hence my question: can the drone relocalize itself within a map without booting up at the exact same position in which the drone was switched on at the time of the creation of the map?

## Reply by Chad Sweet (ModalAI staff) · 2023-02-24 14:27:45 UTC

Not at this time, no

## Reply by afdrus · 2023-02-27 10:09:06 UTC

Ok, thank you very much for your response.
Is this feature under development?

## Reply by Chad Sweet (ModalAI staff) · 2023-02-27 19:52:04 UTC

It is not at this point. You could get pretty far by incorporating April Tag Relocalization, docs [here](https://docs.modalai.com/voxl-vision-px4-apriltag-relocalization/)

## Reply by afdrus · 2023-07-04 10:26:53 UTC (in reply to Chad Sweet)

@Chad-Sweet thanks for the reply and sorry for coming back to this question just now. Is it possible to leverage the relocalization directly in the EKF of the VIO (i.e. the position estimate which is sent to PX4/external autopilot)? My question comes from the fact that, in my tests, I was only able to see the effect of the relocalization either via the debug command
```
voxl-inspect-pose -f
```
or by sending a SET_POSITION_TARGET_LOCAL_NED mavlink message. However, with the drone disarmed, I am not seeing any change in the location of the drone in the map. Is this the expected behavior?

## Reply by Chad Sweet (ModalAI staff) · 2023-07-04 17:09:13 UTC (in reply to afdrus)

@afdrus the relocalization is external to the VIO EKF. You can trace this code path here: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-hub/-/blob/master/src/tag_manager.c#L110
