ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.1k stars 9.69k forks source link

Unable to create local_map using msf_local_map_creator #3152

Closed ankitvora7 closed 6 years ago

ankitvora7 commented 6 years ago

I want to generate a local_map in order to use the msf localization. I have the PCD files, pose files (and pose.txt), zone id. I execute the msf_local_map_Creator.sh with args - data/pcd data/pcd/pose.txt zone_id and this is what I get. I'm unable to figure out what exactly is the problem.

Pcd folders are as follows: ./data/pcd/ Saved the map configuration to: ./data/maps/lossless_map/config.xml. Saved the map configuration to: ./data/maps/lossless_map/config.xml. WARNING: Logging before InitGoogleLogging() is written to STDERR E0302 18:59:17.852425 10346 velodyne_utility.cc:46] Un-organized-point-cloud Loaded 30535 3D Points at Trial: 0 Frame: 0. E0302 18:59:17.884428 10346 base_map.cc:100] GetMapNodeSafe: This node don't exist in cache! E0302 18:59:17.884428 10346 base_map.cc:101] load this node from disk now! index = Map node (Resolution ID: 0 Zone ID: 17 Easting: 0 Northing: 0) E0302 18:59:17.884428 10346 base_map.cc:266] Created map node: Map node (Resolution ID: 0 Zone ID: 17 Easting: 0 Northing: 0) F0302 18:59:17.884428 10346 lossless_map_node.cc:38] Check failed: is_success Check failure stack trace: ./scripts/msf_local_map_creator.sh: line 19: 10346 Aborted (core dumped) $APOLLO_BIN_PREFIX/modules/localization/msf/local_tool/map_creation/lossless_map_creator --use_plane_inliers_only true --pcd_folders $1 --pose_files $2 --map_folder $4 --zone_id $3 --coordinate_type UTM --map_resolution_type single Resolution: 0.125 Dataset: ./data/pcd/ Loaded the map configuration from: ./data/maps/lossless_map//config.xml. terminate called after throwing an instance of 'boost::filesystem::filesystem_error' what(): boost::filesystem::directory_iterator::construct: No such file or directory: "./data/maps/lossless_map//map" ./scripts/msf_local_map_creator.sh: line 25: 10363 Aborted (core dumped) $APOLLO_BIN_PREFIX/modules/localization/msf/local_tool/map_creation/lossless_map_to_lossy_map --srcdir $4/lossless_map --dstdir $4

ankitvora7 commented 6 years ago

Any idea what's going wrong ?

HaoLi-China commented 6 years ago

@ankitvora7 , The format of the poses file is "pcd_number timestamp x y z qx qy qz qw". Please check the format of your pose files. And there should be an one-to-one match between pcd_number and pcd files' name. For example, 1.pcd 2.pcd 3.pcd ... After this, if the problem still exists, please contact us.

JinglinZhang commented 6 years ago

@HaoLi-China Hi, HaoLi, I generate pcd files in PointXYZIT type, name them as 1.pcd, 2.pcd,..., and get the same error:

Pcd folders are as follows:
data/map_data/pcds
Saved the map configuration to: data/map_data/hdmap/lossless_map/config.xml.
Saved the map configuration to: data/map_data/hdmap/lossless_map/config.xml.
zjl test 279 pcd_file_path 1: data/map_data/pcds/1.pcd
WARNING: Logging before InitGoogleLogging() is written to STDERR
E0313 21:11:16.974522  7495 velodyne_utility.cc:46] Un-organized-point-cloud
zjl test 54 pcd file 1 content: 0.000688656, 7.89142, 0.963352, 10, 1.51004e+15
Loaded 64412 3D Points at Trial: 0 Frame: 0.
E0313 21:11:17.041604  7495 base_map.cc:100] GetMapNodeSafe: This node don't exist in cache! 
E0313 21:11:17.041615  7495 base_map.cc:101] load this node from disk now! index = Map node (Resolution ID: 0 Zone ID: 50 Easting: 0 Northing: 0)
E0313 21:11:17.041672  7495 base_map.cc:266] Created map node: Map node (Resolution ID: 0 Zone ID: 50 Easting: 0 Northing: 0)
F0313 21:11:17.041695  7495 lossless_map_node.cc:38] Check failed: is_success 
*** Check failure stack trace: ***
scripts/msf_local_map_creator.sh: line 19:  7495 Aborted                 (core dumped) $APOLLO_BIN_PREFIX/modules/localization/msf/local_tool/map_creation/lossless_map_creator --use_plane_inliers_only true --pcd_folders $1 --pose_files $2 --map_folder $4 --zone_id $3 --coordinate_type UTM --map_resolution_type single
Resolution: 0.125
Dataset: data/map_data/pcds
Loaded the map configuration from: data/map_data/hdmap/lossless_map/config.xml.
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
  what():  boost::filesystem::directory_iterator::construct: No such file or directory: "data/map_data/hdmap/lossless_map/map"
scripts/msf_local_map_creator.sh: line 25:  7512 Aborted                 (core dumped) $APOLLO_BIN_PREFIX/modules/localization/msf/local_tool/map_creation/lossless_map_to_lossy_map --srcdir $4/lossless_map --dstdir $4

My pcd file is like this:

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z intensity timestamp
SIZE 4 4 4 1 8
TYPE F F F U F
COUNT 1 1 1 1 1
WIDTH 64412
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 64412
DATA ascii
0.000688656 7.8914165 0.96335226 10 1.5100393e+15
0.00082582224 7.8860216 0.68827319 20 1.5100393e+15
0.0013530329 12.920512 0.90258384 33 1.5100393e+15

the pose file is:

1 1510039305131956 -0.195675000 8.113770000 0.249229000 -0.000316777 -0.008658948 0.731425346 0.681866923
ankitvora7 commented 6 years ago

@HaoLi-China - I was able to run the offline lidar visualizer demo with the same pose and pcd data which means the data is fine. I think that the code is looking for layers/tiles even for a map that doesn't even exist. And Hence it throws the "Nu such file" error for the lossless_map/map directory. Even @JinglinZhang got the same error.

JinglinZhang commented 6 years ago

@ankitvora7 The coordinate_type variable cause this problem. When your pose is local pose, the coordinate_type should be LTM or the off_x and off_y while be negitive numbers which lead function BaseMapNode::GetCoordinate return false.

HaoLi-China commented 6 years ago

@JinglinZhang , you are right. @ankitvora7, the default coordinate_type in our map creation is UTM. If you use other coordinate_type, please change the coordinate_type in map creation script.

natashadsouza commented 6 years ago

Closing this issue as there has been no communication in a while. Please feel free to open it if you have additional questions.