#!/bin/bash # Warning: This script is ONLY for ROS2 Humble in ubuntu 22.04 # set -x set -e if [ -d "~/smc/cartographer_ws/src" ]; then echo " cartographer workspace already exists, skip creating." else echo "Creating cartographer_ws workspace" source /opt/ros/humble/setup.bash mkdir -p ~/smc/cartographer_ws/src cd ~/smc/cartographer_ws/src git clone http://hualiyun.cc:7000/ros2/cartographer git clone http://hualiyun.cc:7000/ros2/cartographer_ros cd .. echo "Building cartographer_ws..." colcon build echo "source ~/smc/cartographer_ws/install/setup.bash" >> ~/.bashrc fi