フィルターのクリア

How to save map after SLAM

6 ビュー (過去 30 日間)
Ahmed Magdy
Ahmed Magdy 2023 年 9 月 10 日
コメント済み: Ahmed Magdy 2023 年 9 月 14 日
To save the map generated during the SLAM session, I can use the map_saver package provided by ROS and save it as two files:
.pgm file and .yaml file.
In Lidar_Slam_Sim example, I only have a chance to visualize the generated map using the video display, as shown in the image.
How can I save the .pgm and . yaml files from simulink?

採用された回答

Zheng Dong
Zheng Dong 2023 年 9 月 12 日
Hi Ahmed,
Here is a workaround for your question. The prototype is attached.
In summary, you can add a blank nav_msgs/OccupancyGrid type message as an input to your lidar SLAM block and then utilize the function "fcn" in the demo block to overwrite the message with the map data you got from the SLAM algorithm. In the prototype, a random occupancyMap is used, but in your case it will be the occupancyMap you got from the lidar SLAM. Then you can publish it to map_saver to output the map.
Hope it helps,
Best,
Zheng
  7 件のコメント
Zheng Dong
Zheng Dong 2023 年 9 月 14 日
Hi Ahmed,
This is because 128 is the default maximum length for message. Find "Variable Size Messages" in "SIMULATION" section, choose "nav_msgs/OccupancyGrid", uncheck "Use default limits for this message type", and then specify a number is larger than your map data size (82944 in your figure). Check the figure for more details.
Best,
Zheng
Ahmed Magdy
Ahmed Magdy 2023 年 9 月 14 日
Hi Zheng,
Thank you so much for your effort and time. Everything is working exactly as it should be.
Best

サインインしてコメントする。

その他の回答 (1 件)

Ajay
Ajay 2023 年 9 月 12 日
yes
  1 件のコメント
Ahmed Magdy
Ahmed Magdy 2023 年 9 月 12 日
How?
In Lidar_Slam_Sim example, I only have a chance to visualize the generated map using the video display, as shown in the image.
How can I save the .pgm and . yaml files from simulink?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLabeling, Segmentation, and Detection についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by