Create pgm map from Gazebo world file for ROS localization. This fork deals with build errors and map generation errors that occur using later ROS, Gazebo, and Boost versions.
Tested on Ubuntu 18.04, ROS Melodic, Gazebo 9.0, Boost 1.65
- Create a catkin workspace
- Clone the package to the src folder
- Add the following definition to top of /usr/include/boost/gil/extension/io/png_io_private.hpp:
#define int_p_NULL (int*)NULL
- in pgm_map_creator/src/collision_map_creator.cc make the following changes due to changes in Gazebo physics::World class method names:
line 35: Change getName()
to Name()
line 91: GetPhysicsEngine()
to Physics()
- To avoid protobuf compiler errors related to vector2d.proto already being included (as may happen if other packages in the same workspace share this dependency), in /catkin_ws/src/pgm_map_creator/msgs/CMakeLists.txt:
change this
set (msgs
collision_map_request.proto
${PROTOBUF_IMPORT_DIRS}/vector2d.proto
${PROTOBUF_IMPORT_DIRS}/header.proto
${PROTOBUF_IMPORT_DIRS}/time.proto
)
to
set (msgs
collision_map_request.proto
${PROTOBUF_IMPORT_DIRS}/header.proto
${PROTOBUF_IMPORT_DIRS}/time.proto
)
catkin_make
and sourcedevel/setup.bash
- Add your world file to world folder
- Add this line at the end of the world file, before
</world>
tag:<plugin filename="libcollision_map_creator.so" name="collision_map_creator"/>
- Open a terminal, run gzerver with the map file
gzserver src/pgm_map_creator/world/<map file>
- Open another terminal, launch the request_publisher node
roslaunch pgm_map_creator request_publisher.launch
- Wait for the plugin to generate map. It will be located in the map folder
Currently, please update the argument value in launch/request_publisher.launch file.