Repository navigation
Porting from MultiagentMapping
- Packages renamed to maplab (
multiagent_mapping_common->maplab_common) - Shared ptrs in VIMap removed
- VIMap ResourceLoader changed
- namespace from VIMap changed to
vi_maptoviwls_graph - Removed
MappedContainerBase(usingstd::unordered_mapinstead) - Changed Aligned typedefs (from
AligenedXXX<Type>::typetoAlignedXXX<Type>) - Typedef
UniquePtrnow points toAlignedUniquePtr(instead ofstd::unique_ptr)
-
Clone multiagent_mapping. If you already work on this repo, it's recommended to create a second clone to do this.
git clone git@github.com:ethz-asl/multiagent_mapping.git
-
Next we need to isolate the desired package and move it do the subfolder we want it in maplab.
-
Move all files inside
PACKAGE_PATHto the git root and remove all other files:git filter-branch --subdirectory-filter PACKAGE_PATH/ -- --all
-
Move all the files left in the repo (the ones that were in
PACKAGE_PATH) back into a subfolderNEW_PACKAGE_PATH:git filter-branch -f --index-filter \ 'git ls-files -s | sed "s-\t\"*-&NEW_PACKAGE_PATH/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info && mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
Important:
- Some characters like
-inNEWSUBDIRneed to be escaped by\- - On OSX,
\tdoesn't work. You need to replace\tby a literal tab, for example by pressing Ctrl+V and then Tab in your console
-
-
Then, you can merge your directory from
multiagent_mappingintomaplab:cd path/to/maplab git checkout -b feature/import-DIRECTORY git remote add muma_DIRECTORY path/to/prepared/multiagent_mapping git fetch muma_DIRECTORY git merge muma_DIRECTORY/master # or whichever branch you want to merge # Use flag --allow-unrelated-histories with merge if you're on a newer git version. git remote remove muma_DIRECTORY
feature/import-DIRECTORY(name of the branch to merge in) andmuma_DIRECTORY(name of the remote) can be anything you want.
Sources:
- http://stackoverflow.com/questions/3142419/how-can-i-move-a-directory-in-a-git-repo-for-all-commits
- http://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories
Remove all files that don't match expression REG_EXPR:
git filter-branch --tree-filter "find . -type f ! -name 'REG_EXPR' -delete" HEAD# Run in the root of your package -- goes through all of the files in `.`!
# Header guards, macros.
# Careful: This will also change `MULTIAGENT_MAPPING_TEST_DATA_DIR` which we need to keep as is for now.
find . -type f -exec sed -i 's/MULTIAGENT_MAPPING/MAPLAB/g' {} +
# Common rename.
find . -type f -exec sed -i 's/multiagent_mapping_common/maplab_common/g' {} +
find . -type f -exec sed -i 's/multiagent-mapping-common/maplab-common/g' {} +# Run in the root of your package -- goes through all of the files in `.`!
find . -type f -exec sed -i 's/Aligned\(.*\)>::type/Aligned\1>/g' {} +- Only changes one-line definitions -- multi-line definitions need to be manually addressed
- Also need to change allocation for
UniquePtrtype
# Run in the root of your package -- goes through all of the files in `.`!
find . -type f -exec sed -i 's/viwls_graph/vi_map/g' {} +Also changes namespaces of other types that were in the package viwls_graph before, these need to be manually changed.
grep -irn "dmap"Also matches IdMap.
grep -irn "multiagent"Works with multiagent mapping separated by space, - or _, or as one word.
grep -rn "shared_ptr\|::Ptr\|::ConstPtr"