Last active
September 4, 2024 15:24
-
-
Save aarsht7/a354e6aa1a81efdd9d116816c5bc6722 to your computer and use it in GitHub Desktop.
Setup turtlebot3 with ros2 humble on ubuntu 22.04 server on raspberryPi (might take more than 2 hours in total and will need some attention in between). Check out comment for how to run.
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
#!/bin/bash | |
set -e | |
sudo apt update | |
locale # check for UTF-8 | |
sudo apt update && sudo apt install locales net-tools curl software-properties-common -y | |
sudo locale-gen en_US en_US.UTF-8 | |
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
locale # verify settings | |
sudo add-apt-repository universe | |
sudo apt update | |
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null | |
sudo apt update | |
sudo apt install -y ros-humble-ros-base ros-dev-tools python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential ros-humble-hls-lfcd-lds-driver ros-humble-hls-lfcd-lds-driver ros-humble-turtlebot3-msgs ros-humble-dynamixel-sdk libudev-dev | |
sudo fallocate -l 4G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo sed -i '$a\/swapfile swap swap defaults 0 0' /etc/fstab | |
mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src | |
git clone -b humble-devel https://github.com/ROBOTIS-GIT/turtlebot3.git | |
git clone -b ros2-devel https://github.com/ROBOTIS-GIT/ld08_driver.git | |
cd ~/turtlebot3_ws/src/turtlebot3 | |
rm -r turtlebot3_cartographer turtlebot3_navigation2 | |
cd ~/turtlebot3_ws/ | |
source /opt/ros/humble/setup.bash && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release | |
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc | |
echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc | |
source ~/.bashrc | |
source ~/turtlebot3_ws/install/setup.bash && sudo cp `ros2 pkg prefix turtlebot3_bringup`/share/turtlebot3_bringup/script/99-turtlebot3-cdc.rules /etc/udev/rules.d/ | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger | |
sudo sed -i '/\/swapfile swap swap defaults 0 0/d' /etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Method 1:
Method2: