Turtlebot3 Ubuntu18.04 安装ROS2 Dashing

发布时间:2022-06-28 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Turtlebot3 Ubuntu18.04 安装ROS2 Dashing脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

 设置UTF-8编码

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

 

更新软件源

sudo apt update && sudo apt install curl gnupg2 lsb-release
curl http://repo.ros2.org/repos.key | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

  

安装ROS2

sudo apt install ros-dashing-desktop

  

 

 

#!/bin/bash
# Apache License 2.0
# Copyright (c) 2019, ROBOTIS CO., LTD.

echo ""
echo "[Note] OS version  >>> Ubuntu 18.04 (Bionic Beaver) or Linux Mint 19.x"
echo "[Note] Target ROS version >>> ROS 2 Dashing Diademata"
echo "[Note] Colcon workspace   >>> $HOME/colcon_ws"
echo ""
echo "PRESS [ENTER] TO CONTINUE THE INSTALLATION"
echo "IF YOU WANT TO CANCEL, PRESS [CTRL] + [C]"
read

echo "[Set the target ROS version and name of colcon workspace]"
name_ros_version=${name_ros_version:="dashing"}
name_colcon_workspace=${name_colcon_workspace:="colcon_ws"}

echo "[Setup Locale]"
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

echo "[Setup Sources]"
sudo rm -rf /var/lib/apt/lists/* && sudo apt update && sudo apt install -y curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null'

echo "[Install ROS 2 packages]"
sudo apt update && sudo apt install -y ros-$name_ros_version-desktop

echo "[Environment setup]"
source /opt/ros/$name_ros_version/setup.sh
sudo apt install -y python3-argcomplete python3-colcon-common-extensions python3-vcstool git

echo "[Make the colcon workspace and test colcon build]"
mkdir -p $HOME/$name_colcon_workspace/src
cd $HOME/$name_colcon_workspace
colcon build --symlink-install

echo "[Set the ROS evironment]"
sh -c "echo "alias nb='nano ~/.bashrc'" >> ~/.bashrc"
sh -c "echo "alias sb='source ~/.bashrc'" >> ~/.bashrc"
sh -c "echo "alias gs='git status'" >> ~/.bashrc"
sh -c "echo "alias gp='git pull'" >> ~/.bashrc"

sh -c "echo "alias cw='cd ~/$name_colcon_workspace'" >> ~/.bashrc"
sh -c "echo "alias cs='cd ~/$name_colcon_workspace/src'" >> ~/.bashrc"
sh -c "echo "alias cb='cd ~/$name_colcon_workspace && colcon build --symlink-install && source ~/.bashrc'" >> ~/.bashrc"

sh -c "echo "source /opt/ros/$name_ros_version/setup.bash" >> ~/.bashrc"
sh -c "echo "source ~/$name_colcon_workspace/install/local_setup.bash" >> ~/.bashrc"

exec bash

echo "[Complete!!!]"
exit 0

  

 

 

cd ~/catkin_ws/src/
git clone -b dashing-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git
git clone -b dashing-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone -b dashing-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
colcon build --symlink-install

  

脚本宝典总结

以上是脚本宝典为你收集整理的Turtlebot3 Ubuntu18.04 安装ROS2 Dashing全部内容,希望文章能够帮你解决Turtlebot3 Ubuntu18.04 安装ROS2 Dashing所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: