ROS2--笔记0--安装

操作系统:Ubuntu 18.04

设置Locale

确保系统的local支持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 -

然后添加debian仓库到apt源中:

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之前需要安装一些ros2依赖的工具:

sudo apt update && sudo apt install -y \
	build-essential \
	cmake \
	git \
	python3-colcon-common-extensions \
	python3-pip \
	python-rosdep \
	python3-vcstool \
	wget

安装一些用于testing的pip包:

python3 -m pip install -U \
	argcomplete \
	flake8 \
	flake8-blind-except \
	flake8-builtins \
	flake8-class-newline \
	flake8-comprehensions \
	flake8-deprecated \
	flake8-docstrings \
	flake8-import-order \
	flake8-quotes \
	git+https://github.com/lark-parser/lark.git@0.7d \
	pytest-repeat \
	pytest-rerunfailures \
	pytest \
	pytest-cov \
	pytest-runner \
	setuptools

安装Fast-RTPS的依赖库:

sudo apt install --no-install-recommends -y \
	libasio-dev \
	libtinyxml2-dev

安装ROS2软件包

export CHOOSE_ROS_DISTRO=crystal  # or bouncy or ardent
sudo apt update
#安装ROS,RViz,示例以及教程等
sudo apt install ros-$CHOOSE_ROS_DISTRO-desktop
#安装通讯库,message包,命令行工具等
sudo apt install ros-$CHOOSE_ROS_DISTRO-ros-base

设置ROS环境

source /opt/ros/$CHOOSE_ROS_DISTRO/setup.bash
#如下设置将ros应用于整个用户环境,注销或重启后有效
echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值