koide3 / hdl_graph_slam

3D LIDAR-based Graph SLAM
BSD 2-Clause "Simplified" License
1.97k stars 726 forks source link

Failed to run the order for saving map #21

Open ikunjin opened 6 years ago

ikunjin commented 6 years ago

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!

koide3 commented 6 years ago

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").

weisongwen commented 6 years ago

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

koide3 commented 6 years ago

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?

weisongwen commented 6 years ago

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

thanks, welson

ikunjin commented 6 years ago

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

ikunjin commented 5 years ago

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!!

koide3 commented 5 years ago

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

ikunjin commented 5 years ago

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

tranducthuan1 commented 5 years ago

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 commented 5 years ago

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

BurryChen commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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

weisongwen commented 5 years ago

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,

koide3 commented 5 years ago

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

ikunjin commented 5 years ago

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 !

improve100 commented 5 years ago

@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'"

koide3 commented 5 years ago

@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 commented 5 years ago

@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: ''" 
ikunjin commented 5 years ago

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 ! !

koide3 commented 5 years ago

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

ikunjin commented 5 years ago

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

DavidJamesOKC commented 5 years ago

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 commented 5 years ago

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

imawesome61 commented 5 years ago

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 .

koide3 commented 5 years ago

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

koide3 commented 5 years ago

@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.

sanjanawill commented 5 years ago

@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.

Leedk3 commented 4 years ago

@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.

and this was the cause. Thank you

Leedk3 commented 4 years ago

@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

amina-bot commented 4 years ago

I solved this problem by upgrading and updating my ubuntu. consider trying this.

NohSeungWook commented 7 months ago

I solved this problem by entering the command below.

rosservice call /hdl_graph_slam/save_map false 0.05 '/you_full_path_directory/map.pcd'

Yes, I think this is a simple issue of unfamiliarity with rosservice - if you only enter the argument as a list of values, not in property: value format, it will usually work.