forked from Soldann/MORB_SLAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New java style enums * Compile with new java style enums * change some locks * Clean more and add comments * Clean mostly iterators * Make refactor readability changes Co-authored-by: Nicole Jin <[email protected]> Co-authored-by: justinmetivier <[email protected]> * Fix compile issues * clean up some of the iterators and formatting * Remove unused functions and member fields * Remove unused variables or take out more member variables * Resolve nan issue * fixes Soldann#14 * Merge 9 minimum cmake version (Soldann#18) * Update cmake to be compatible with latest minor version from apt * Add dependency installer * Update readme to show install and build instructions * Reverted some breaking slam 'refactoring' (Soldann#19) SLAM would not continue to 'spam print' and would frequently have invalid_argument exceptions thrown or other segmentation faults. This was due to some changes that were accidentally made to for loops in an invalid way. We reverted more than might have been required but not much. --------------- Co-authored-by: Nicole Jin <[email protected]> * Potentially fix segfault from PredictStateIMU * fixes Soldann#22 * Add quality of life changes for cmake, build, and clean * Handle compile warnings and issues when compiling with clang17 and c++20 * Address g2o clang compile typeid warnings * Call PoseOptimization if there are no imu frames in track local map --------- Co-authored-by: Nicole Jin <[email protected]> Co-authored-by: justinmetivier <[email protected]> Co-authored-by: Nicole Jin <[email protected]>
- Loading branch information
1 parent
98c94b9
commit 67cf5a2
Showing
50 changed files
with
1,124 additions
and
2,462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,89 @@ | ||
#!/bin/bash | ||
|
||
if [ $# == "1" ]; then | ||
jobs=$1 | ||
else | ||
jobs="-j$(nproc)" | ||
fi | ||
echo "Using argument ${jobs}" | ||
|
||
# https://stackoverflow.com/questions/24112727/relative-paths-based-on-file-location-instead-of-current-working-directory | ||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$parent_path" # change directories so working directory is where the script is | ||
|
||
cd Vocabulary | ||
if [ ! -f "ORBvoc.txt" ]; then | ||
echo "Uncompress vocabulary ..." | ||
# Initialize lists | ||
cmake_args=() | ||
j_arg="-j$(nproc)" | ||
g_arg="" | ||
# Iterate over arguments | ||
for arg in "$@"; do | ||
if [[ $arg =~ ^-j[0-9]+$ ]]; then | ||
j_arg="$arg" | ||
elif [[ $arg =~ ^-G[0-9a-zA-Z]+$ ]]; then | ||
g_arg="$arg" | ||
else | ||
cmake_args+=("$arg") | ||
fi | ||
done | ||
# Check if the g_arg is empty (non-user specified generator) | ||
if [ -z "$g_arg" ]; then | ||
# select ninja if available, make otherwise | ||
if which ninja >/dev/null 2>&1; then | ||
g_arg="-GNinja" | ||
elif which make >/dev/null 2>&1; then | ||
g_arg="-GMake" | ||
else | ||
echo "Please either install Ninja (preffered), Make, or specify an installed Generator?" | ||
echo " For ninja `sudo apt install ninja-build`" | ||
echo " For make `sudo apt install build-essential`" | ||
exit -1 | ||
fi | ||
fi | ||
|
||
|
||
if [ ! -f "Vocabulary/ORBvoc.txt" ]; then | ||
cd Vocabulary | ||
echo "Extracting vocabulary..." | ||
tar -xf ORBvoc.txt.tar.gz | ||
echo "ORB Vocabulary extracted" | ||
cd $parent_path | ||
else | ||
echo "ORB Vocabulary already extracted" | ||
fi | ||
cd .. | ||
|
||
if [ ! -d "build" ] || [ ! -f 'build/config-finished.bool' ]; then | ||
echo 'Performing first time configuration' | ||
configCompleteFile='config-finished.bool' | ||
# https://unix.stackexchange.com/questions/31414/how-can-i-pass-a-command-line-argument-into-a-shell-script | ||
if [ ! -d "build" ] || [ ! -f "build/${configCompleteFile}" ]; then | ||
echo 'Performing first time configuration...' | ||
echo "Workers: ${j_arg} Generator: ${g_arg}" | ||
echo "User Flags: ${cmake_args[@]}" | ||
mkdir build 2> /dev/null | ||
cd build | ||
# https://unix.stackexchange.com/questions/31414/how-can-i-pass-a-command-line-argument-into-a-shell-script | ||
cmake .. -GNinja | ||
cmake .. ${g_arg} "${cmake_args[@]}" # pass arguments on to cmake | ||
if [ $? -ne 0 ]; then | ||
rm 'config-finished.bool' 2> /dev/null | ||
rm "${configCompleteFile}" 2> /dev/null | ||
cd .. | ||
echo "Configuration was not successful" | ||
exit 1 | ||
fi | ||
touch 'config-finished.bool' | ||
touch "${configCompleteFile}" | ||
echo -e " Generator: ${g_arg}\nUser Flags: ${cmake_args[@]}" > "${configCompleteFile}" | ||
else | ||
echo 'Already configured' | ||
cd build | ||
config=$(cat "${configCompleteFile}") | ||
echo "Workers: ${j_arg}${config}" | ||
fi | ||
ninja $jobs | ||
|
||
if [ $? -ne 0 ]; then | ||
cd .. | ||
echo "Configuration was not successful" | ||
exit 1 | ||
fi | ||
echo "Building..." | ||
cmake --build . -- ${j_arg} | ||
if [ $? -ne 0 ]; then | ||
cd .. | ||
echo "Build was not successful" | ||
exit 2 | ||
fi | ||
sudo ninja install | ||
sudo cmake --install . | ||
if [ $? -ne 0 ]; then | ||
cd .. | ||
echo "Install was not successful" | ||
exit 3 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$parent_path" # change directories so working directory is where the script is | ||
|
||
#apt update for good measure | ||
sudo apt update | ||
|
||
sudo apt install -y build-essential cmake ninja-build libeigen3-dev libssl-dev libboost-all-dev libopencv-dev libpython3.9 | ||
|
||
#pangolin | ||
git clone --recursive https://github.com/stevenlovegrove/Pangolin.git --depth=1 -b v0.8 | ||
cd Pangolin | ||
|
||
./scripts/install_prerequisites.sh -m recommended | ||
|
||
mkdir build | ||
cd build | ||
|
||
set -e # set to abort on error | ||
|
||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
make -j$(nproc) | ||
sudo make install | ||
sudo ldconfig > /dev/null 2> /dev/null | ||
|
||
echo "Finished installing all of the dependencies! Now just run build.sh! You can use -jX for choosing the number of workers with build.sh. default:-j$(nproc)" |
Oops, something went wrong.