[ROS Melodic + Jetson Nano] Unable to save .tif map with Hector_Slam - Unsupported image format

Hello,

I’m quite new to ROS system and I’m trying to build an autonomous robot for a school project using a Jetson Nano (Ubuntu 18.04) with an YDLIDAR X4 Lidar. The robots need to be autonomous (hence the lidar) and needs to do social-distancing measurements (Jetson-inference will be used).

I’ve managed to build the ROS environment and managed to configure Hector_Slam package in order to create “live” map in Rviz following this tutorial : create.arduino.cc and used this command when faced issue with the “catkin_make” command after installing the Hector_slam package :

cd /usr/include
sudo ln -s opencv4/ opencv

from this tutorial : hackster.io

Now I want to save the map created after scanning my environment with the combo lidar/hector_slam using the following lines to launch the process :

  1. roslaunch ydlidar lidar.launch
  2. roslaunch hector_slam_launch tutorial.launch

However when I enter the code for saving a .tif image (rostopic pub syscommand std_msgs/String “savegeotiff”) the terminal used to start the mapping process tells me the following error :

Writing image with file /home/gribouille/catkin_ws/src/hector_slam/hector_geotiff/maps/hector_slam_map_17:56:55.tif failed with error Unsupported image format [ INFO] [1609952216.135949482]: GeoTiff created in 0,252163 seconds

Resulting with just a .tfw file and no .tif file. Any idea why I can’t manage to save my map ?
Should you need more information let me know!

Please find hereafter the terminal log.

SUMMARY

PARAMETERS * /hector_geotiff_node/draw_background_checkerboard: True * /hector_geotiff_node/draw_free_space_grid: True * /hector_geotiff_node/geotiff_save_period: 0.0 * /hector_geotiff_node/map_file_base_name: hector_slam_map * /hector_geotiff_node/map_file_path: /home/gribouille/… * /hector_geotiff_node/plugins: hector_geotiff_pl… * /hector_mapping/advertise_map_service: True * /hector_mapping/base_frame: base_footprint * /hector_mapping/laser_z_max_value: 1.0 * /hector_mapping/laser_z_min_value: -1.0 * /hector_mapping/map_frame: map * /hector_mapping/map_multi_res_levels: 2 * /hector_mapping/map_resolution: 0.05 * /hector_mapping/map_size: 2048 * /hector_mapping/map_start_x: 0.5 * /hector_mapping/map_start_y: 0.5 * /hector_mapping/map_update_angle_thresh: 0.06 * /hector_mapping/map_update_distance_thresh: 0.4 * /hector_mapping/odom_frame: base_footprint * /hector_mapping/pub_map_odom_transform: True * /hector_mapping/scan_subscriber_queue_size: 5 * /hector_mapping/scan_topic: scan * /hector_mapping/tf_map_scanmatch_transform_frame_name: scanmatcher_frame * /hector_mapping/update_factor_free: 0.4 * /hector_mapping/update_factor_occupied: 0.9 * /hector_mapping/use_tf_pose_start_estimate: False * /hector_mapping/use_tf_scan_transformation: True * /hector_trajectory_server/source_frame_name: scanmatcher_frame * /hector_trajectory_server/target_frame_name: /map * /hector_trajectory_server/trajectory_publish_rate: 0.25 * /hector_trajectory_server/trajectory_update_rate: 4.0 * /rosdistro: melodic * /rosversion: 1.14.10 * /use_sim_time: False

NODES / hector_geotiff_node (hector_geotiff/geotiff_node) hector_mapping (hector_mapping/hector_mapping) hector_trajectory_server (hector_trajectory_server/hector_trajectory_server) map_nav_broadcaster (tf/static_transform_publisher) rviz (rviz/rviz)

ROS_MASTER_URI=http://localhost:11311

process[rviz-1]: started with pid [12960] process[hector_mapping-2]: started with pid [12961] process[map_nav_broadcaster-3]: started with pid [12962] process[hector_trajectory_server-4]: started with pid [12967] process[hector_geotiff_node-5]: started with pid [12970] [ INFO] [1609952202.639589174]: Creating application with offscreen platform. [ INFO] [1609952202.644869435]: Created application [ INFO] [1609952202.662508289]: Waiting for tf transform data between frames /map and scanmatcher_frame to become available HectorSM map lvl 0: cellLength: 0.05 res x:2048 res y: 2048 HectorSM map lvl 1: cellLength: 0.1 res x:1024 res y: 1024 [ INFO] [1609952202.779434331]: HectorSM p_base_frame_: base_footprint [ INFO] [1609952202.783897768]: HectorSM p_map_frame_: map [ INFO] [1609952202.784017195]: HectorSM p_odom_frame_: base_footprint [ INFO] [1609952202.784067664]: HectorSM p_scan_topic_: scan [ INFO] [1609952202.784110268]: HectorSM p_use_tf_scan_transformation_: true [ INFO] [1609952202.784161622]: HectorSM p_pub_map_odom_transform_: true [ INFO] [1609952202.784203758]: HectorSM p_scan_subscriber_queue_size_: 5 [ INFO] [1609952202.784250216]: HectorSM p_map_pub_period_: 2.000000 [ INFO] [1609952202.784293706]: HectorSM p_update_factor_free_: 0.400000 [ INFO] [1609952202.784333706]: HectorSM p_update_factor_occupied_: 0.900000 [ INFO] [1609952202.784373497]: HectorSM p_map_update_distance_threshold_: 0.400000 [ INFO] [1609952202.784412716]: HectorSM p_map_update_angle_threshold_: 0.060000 [ INFO] [1609952202.784464904]: HectorSM p_laser_z_min_value_: -1.000000 [ INFO] [1609952202.784504956]: HectorSM p_laser_z_max_value_: 1.000000 [ INFO] [1609952202.823346466]: Successfully initialized hector_geotiff MapWriter plugin TrajectoryMapWriter. [ INFO] [1609952202.830251987]: Geotiff node started [ INFO] [1609952203.672695528]: Finished waiting for tf, waited 1.010283 seconds [ INFO] [1609952215.814598857]: HectorSM sysMsgCallback, msg contents: savegeotiff [ INFO] [1609952215.917784013]: HectorSM Map service called [ INFO] [1609952215.940842867]: GeotiffNode: Map service called successfully [ INFO] [1609952216.135793700]: Writing image with file /home/gribouille/catkin_ws/src/hector_slam/hector_geotiff/maps/hector_slam_map_17:56:55.tif failed with error Unsupported image format [ INFO] [1609952216.135949482]: GeoTiff created in 0,252163 seconds

Regards,

Hi @SupR-Pingou, I haven’t used hector_slam before, but it appears to be using Qt5 to save the .tif image:

From the Qt5 docs, it appears that TIF is supported via plugins. Have you tried running sudo apt-get install qt5-image-formats-plugins?

Hi @dusty_nv,

Tried to install the Qt5 image formats plugins as per your recommandation and it works now !
Thanks a lot for your support.

I had to install Qt4 dev tools (sudo apt-get install qt4-qmake qt4-dev-tools) in order to perform catkin_make compilation after installing the Hector_slam package but I guess support for TIF image writing was not in this package.

Regards,

i got .tif image which i saved but i don’t know how to run these saved image
like
rosrun map_server map_server
please help

Hi kravinash318,

Please help to open a new topic with more information.

Thanks