Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Custom cartographer installation to not update system protobuf
cd ~/catkin_ws
# Install wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
# Build sources with old protobuf firstly
catkin_make_isolated --install --use-ninja -DCATKIN_ENABLE_TESTING=false
wstool init src
# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
wstool merge -t src ~/catkin_ws/src/plato/installation_scripts/cartographer.rosinstall
wstool update -t src
# Install proto3 locally.
# Build and install in 'catkin_ws/protobuf/install' proto3.
set -o errexit
#set -o verbose
git clone
cd protobuf
git checkout tags/${VERSION}
mkdir build
cd build
cmake -G Ninja \
-Dprotobuf_BUILD_TESTS=OFF \
ninja install
cd ../../
# Install deb dependencies.
# The command 'sudo rosdep init' will print an error if you have already
# executed it since installing ROS. This error can be ignored.
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
# Build and install.
catkin_make_isolated --install --use-ninja \
-DCMAKE_PREFIX_PATH="${PWD}/install_isolated;${PWD}/protobuf/install;${CMPF}" \
source install_isolated/setup.bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment