hdl_graph_slam icon indicating copy to clipboard operation
hdl_graph_slam copied to clipboard

Failed to run the order for saving map

Open ikunjin opened this issue 6 years ago • 32 comments

Hi,the following error occurs when I run "rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'"" of example 1 in my own PC.

ERROR: service [/hdl_graph_slam/save_map] responded with an error: : [pcl::PCDWriter::writeBinary] Error during open!

Please can you help me figure out this problem? Thanks a lot!

ikunjin avatar Jul 19 '18 08:07 ikunjin

I think you have to specify a destination where the map will be written instead of "/full_path_directory/map.pcd" (e.g., "/tmp/map.pcd").

koide3 avatar Jul 26 '18 06:07 koide3

hi @koide3 , the command rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" did not work. For example, i want to save the map into my computer with the directory "/home/wenws/mapfile.pcd", the resolution is 0.1. what is the full command to do this?

Best welson

weisongwen avatar Aug 07 '18 18:08 weisongwen

hi @weisongwen , The command should be:

rosservice call /hdl_graph_slam/save_map "resolution: 0.1
destination: '/home/wenws/mapfile.pcd'"

How the command failed? Nothing happened or the program got crashed?

koide3 avatar Aug 13 '18 16:08 koide3

hi @koide3 , It works now, there is something wrong on my ros previously.

thanks, welson

weisongwen avatar Aug 20 '18 23:08 weisongwen

Hi,@koide3 ,now it works well. Thank you very much!!

ikunjin avatar Aug 27 '18 09:08 ikunjin

Hi,@koide3,it works well with the .bag data collected by my own lidar.But when i do real-time slam with my lidar and also remap the topic,it fails.It seems that only the .bag file works. Please could you tell me what i should do to deal with the problem? Thanks a lot!!

ikunjin avatar Sep 19 '18 09:09 ikunjin

Hi @ikunjin, How did it fail? Please check if use_sim_time is set to false.

koide3 avatar Sep 24 '18 13:09 koide3

Hi,@koide3,thank you for your advice.When I set use_sim_time to false,the problem has disappeared. Thank you very much !

ikunjin avatar Sep 25 '18 02:09 ikunjin

Dear Prof. Koide,

I have a problem when saving the map file.

The error shows that: Unable to load type [hdl_graph_slam/SaveMap]. then, : have you typed 'make' in [hdl_graph_slam]?

Could you help me to solve it, please.

I look forward to hearing from you.

Yours sincerely, Tran

tranducthuan1 avatar Oct 03 '18 04:10 tranducthuan1

after I changed the "source devel/setup.bash" . The error is yaml.scanner.ScannerError: mapping values are not allowed here in "", line1, column 29 -->destination

tranducthuan1 avatar Oct 03 '18 08:10 tranducthuan1

@koide3 @tranducthuan1 When input rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/home/whu/data/hdl_graph/map.pcd'" I have the same error: yaml.scanner.ScannerError: mapping values are not allowed here in "", line 1, column 29: resolution: 0.05 destination: '/home/whu/data/hdl_graph/map.pcd'

BurryChen avatar Oct 06 '18 18:10 BurryChen

@tranducthuan1 I have solved the problem. After rviz -d hdl_graph_slam.rviz, then execute two lines command rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" with "\".

BurryChen avatar Oct 08 '18 12:10 BurryChen

Dear @BurryChen ,

Thank you so much.

Actually, I also solved it problem yesterday.

I am sorry for my late response.

Did you try this map for the next step of localization?

I have got an error of the tf, the map has not yet match the localization.

Tran

tranducthuan1 avatar Oct 08 '18 13:10 tranducthuan1

hi @koide3 , It seems that only if i visualizae the generated real-time map, will the rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" work. Otherwise, there will no cpd map output?

do yuou have any suggestions on this?

best, weisong,

weisongwen avatar Oct 19 '18 23:10 weisongwen

hi @weisongwen , I found that the code didn't store the data for map generation when no one subscribes the map topic for visualization. Could you try the latest commit in which the bug is fixed?

Best, Kenji

koide3 avatar Oct 22 '18 10:10 koide3

Hi @koide3 , you say that pcl1.7 causes a segfault in debug mode . So i am confused that with ros-indigo and pcl-1.7.1 in my PC , if i want to debug the programm what i should do? Please can you give me some advice? Thanks a lot !

ikunjin avatar Oct 23 '18 03:10 ikunjin

@tranducthuan1 I have solved the problem. After rviz -d hdl_graph_slam.rviz, then execute two lines command rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" with "".

i try $ rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" failed but this is ok. $ rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'"

improve100 avatar Oct 23 '18 03:10 improve100

@ikunjin This is a known bug on PCL 1.7 binary. To avoid it, you have to disable c++11 option or re-build pcl from the source. In short, it's so hard to get rid of this bug.

https://github.com/PointCloudLibrary/pcl/issues/619 https://stackoverflow.com/questions/26346690/debug-seg-fault-in-boostmathlanczos-with-libpcl-surface

koide3 avatar Oct 23 '18 04:10 koide3

@tranducthuan1 It's just a format error. Use auto-completion by pressing TAB, and do not copy and paste the command.

rosservice call /hdl_graph_slam/save_map <TAB><TAB>

You'll see a blank data in the correct format like this. Just fill the arguments.

rosservice call /hdl_graph_slam/save_map "utm: false
resolution: 0.0
destination: ''" 

koide3 avatar Oct 23 '18 04:10 koide3

Hi, @koide3, thanks very much for your guidance, i solve it by rebuilding pcl from the source. But now i have a new problem. I add "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb" to CMAKE_CXX_FLAGS and set CMAKE_BUILD_TYPE to Debug in the CmakeLists.txt, also adding "launch-prefix="xterm -e gdb --args" " to the .launch file(for example, the prefiltering_nodelet). The xterm tells "no debug symbols found" and "no executable file specified". It seems that using nodelet, different from node,cmake generates dynamic link library--the .so file by the CmakeLists.txt, so gdb can not work. Please can you help me point out where i am wrong? Thank you very much again ! !

ikunjin avatar Oct 24 '18 13:10 ikunjin

hi @ikunjin , Unfortunately, I'm not familiar with running a debugger on nodelets. I think the following topic would be helpful for you. http://ros-users.122217.n3.nabble.com/debugging-nodelets-td2370662.html

koide3 avatar Oct 25 '18 14:10 koide3

Hi @koide3,I will continue to learn about this issue.Anyway,i am extremely grateful for your precious advice.

ikunjin avatar Oct 26 '18 07:10 ikunjin

hello, @koide3 , I want to save a map.pcd file by running "rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/data/map.pcd'"". But the terminal show a error: ERROR: Service [/hdl_graph_slam/save_map] is not available. I try solve, but it still is this error. I'm looking forward your reply. thanks.

DavidJamesOKC avatar Dec 08 '18 07:12 DavidJamesOKC

this is some Service results by "rosservice list". /lidar2base_publisher/get_loggers /lidar2base_publisher/set_logger_level /map2odom_publisher/get_loggers /map2odom_publisher/set_logger_level /play_1544254005757280195/get_loggers /play_1544254005757280195/pause_playback /play_1544254005757280195/set_logger_level /prefiltering_nodelet/get_loggers /prefiltering_nodelet/set_logger_level /rosout/get_loggers /rosout/set_logger_level /rviz_1544254009436909375/get_loggers /rviz_1544254009436909375/reload_shaders /rviz_1544254009436909375/set_logger_level /velodyne_nodelet_manager/get_loggers /velodyne_nodelet_manager/list /velodyne_nodelet_manager/load_nodelet

DavidJamesOKC avatar Dec 08 '18 07:12 DavidJamesOKC

Respected sir's, i'm trying to do this on ubuntu 18.04 and none of it works can please any of you help me and tell me which ros should i install and how will i execute this code thanking you in advance .

imawesome61 avatar Dec 18 '18 01:12 imawesome61

hi @DavidJamesOKC , Could you try "rosnode list" to check if the nodelets are launched correctly?

koide3 avatar Dec 19 '18 14:12 koide3

@imawesome61 , I tested this package on "ubuntu 16.04 & ros kinetic" and "ubuntu 18.04 & ros melodic". In case with melodic, try "arch-melodic" branch.

koide3 avatar Dec 19 '18 14:12 koide3

@tranducthuan1 I have solved the problem. After rviz -d hdl_graph_slam.rviz, then execute two lines command rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" with "".

@tranducthuan1 I have solved the problem. After rviz -d hdl_graph_slam.rviz, then execute two lines command rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" with "".

Hi

@tranducthuan1 I have solved the problem. After rviz -d hdl_graph_slam.rviz, then execute two lines command rosservice call /hdl_graph_slam/save_map "resolution: 0.05 destination: '/full_path_directory/map.pcd'" with "".

Hi, @BurryChen I got the same error. Could you please specify the command in more detail.

Thank you.

sanjanawill avatar Mar 20 '19 01:03 sanjanawill

@DavidJamesOKC Did you solve the problem? I'm suffering the same issue now. I can't see the "/save_map" service in the ros-service list.

/hdl_graph_slam_nodelet/get_loggers /hdl_graph_slam_nodelet/set_logger_level /lidar2base_publisher/get_loggers /lidar2base_publisher/set_logger_level /map2odom_publisher/get_loggers /map2odom_publisher/set_logger_level /prefiltering_nodelet/get_loggers /prefiltering_nodelet/set_logger_level /rosout/get_loggers /rosout/set_logger_level /scan_matching_odometry_nodelet/get_loggers /scan_matching_odometry_nodelet/set_logger_level ----------------------------------Solved-------------------------- Hi I figured out the problem.

I commented out the line in launch file due to following comment.

  • in case you use velodyne_driver, comment out the following line
  • node pkg="nodelet" type="nodelet" name="$(arg nodelet_manager)" args="manager" output="screen"

and this was the cause. Thank you

Leedk3 avatar Sep 14 '19 09:09 Leedk3

@koide3 Hello. I have a question. When I enter the command as

rosservice call /hdl_graph_slam/save_map "utm: false resolution: 0.1 destination: '/home/lee/catkin_ws/src/hdl_graph_slam/map/map.pcd'"

the return was " success: False "

I think the rosservice command is same with the others.

Can you give me any comment?

Thank you!

Best, Lee

Leedk3 avatar Sep 16 '19 14:09 Leedk3