# Mapping and Relocalization

**URL:** <https://community.stereolabs.com/t/mapping-and-relocalization/6339>\
**Category:** ROS1\
**Tags:** jetson\
**Created:** [June 18, 2024, 6:21pm UTC](https://community.stereolabs.com/t/mapping-and-relocalization/6339 "2024-06-18T18:21:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sesem738](https://community.stereolabs.com/user_avatar/community.stereolabs.com/sesem738/32/3092_2.png) [@sesem738](https://community.stereolabs.com/u/sesem738)\
**Post date:** [June 18, 2024, 6:21pm UTC](https://community.stereolabs.com/t/mapping-and-relocalization/6339/1 "2024-06-18T18:21:55Z")

</div>

What is the proper way to create a map with the ZED2i?

Do I just edit the ros params to save the area memory?  
Also, how can I get the camera pose in the World coordinates?

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [June 19, 2024, 10:53am UTC](https://community.stereolabs.com/t/mapping-and-relocalization/6339/2 "2024-06-19T10:53:09Z")

</div>

Hi @sesem738,

The area memory allows to save the positional tracking representation for its SLAM algorithm to relocate itself and perform loop closures when located in an area that the camera has already seen before.

To retrieve the camera pose in world coordinates in C++ you can do it as so:

```auto
POSITIONAL_TRACKING_STATE state = zed.getPosition(zed_pose, REFERENCE_FRAME::WORLD);

```

In ROS, the camera pose in world coordinates is available on the topic:

```auto
/zed/zed_node/pose

```

---

<div class="post-metadata">

**Author:** ![sesem738](https://community.stereolabs.com/user_avatar/community.stereolabs.com/sesem738/32/3092_2.png) [@sesem738](https://community.stereolabs.com/u/sesem738)\
**Post date:** [August 19, 2024, 12:50pm UTC](https://community.stereolabs.com/t/mapping-and-relocalization/6339/3 "2024-08-19T12:50:54Z")

</div>

Hi,  
I am trying to save the area\_memory, but I doesn’t seem to save.  
I edited the zed\_wrapper params to save to area\_memory.area. When I launch the zed2i,

```auto
area_memory_db_path [/home/cerveaux/.ros/area_memory.area] doesn't exist or is unreachable. 
[INFO] [1723833173.381376664]: The file will be automatically created when closing the node or calling the 'save_area_map' service if a valid Area Memory is available.

```

However, it doesn’t save when I close node despite it saying,

```auto
Saving Area Memory file: /home/cerveaux/.ros/area_memory.area

```
