ROS
[Grid map] ROS2 GAZEBO -> PNG PGM PCD 생성
Magin
2024. 12. 11. 14:43
728x90
GitHub - arshadlab/gazebo_map_creator
Contribute to arshadlab/gazebo_map_creator development by creating an account on GitHub.
github.com
#Dependencies
sudo apt-get install libboost-dev libpcl-dev
git clone https://github.com/arshadlab/gazebo_map_creator.git
cd ..
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
source ./install/setup.bash
Terminal1
- 사용자가 맵을 디자인하여 만든다면 아래 명령어를 실행 후
해당 Gazebo 맵에서 진행
source ./install/setup.bash
gazebo -s libgazebo_map_creator.so myworld.world
Terminal2
- c : 평면좌표계 기준 좌하단, 우상단 2개의 좌표값을 입력
*여기서 모든 값이 설정하는 resolution하고 비율이 맞아야함
안맞을 경우 생성되는 이미지가 모두 검정색으로 출력
- r : 해상도(resolution)
- f : 파일 이름
$ source ./install/setup.bash
$ ros2 run gazebo_map_creator request_map.py -c '(-4.5,-4.5,0.1)(4.5,4.5,8.0)' -r 0.1 -f ./<저장 위치>
$ ls
map.pcd map.bt map.pgm map.png map.yaml
728x90