ros2 install
TOC前言
- 总要跟上潮流,参与最新实践
参考
记录
二进制安装
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'
export CHOOSE_ROS_DISTRO=crystal
sudo apt update
sudo apt install ros-$CHOOSE_ROS_DISTRO-desktop
# sudo apt install ros-$CHOOSE_ROS_DISTRO-ros-base
# 可选步骤,自动补全工具
sudo apt install python3-pip
sudo pip3 install argcomplete
# source
echo "source /opt/ros/$CHOOSE_ROS_DISTRO/setup.bash" >> ~/.bashrc
安装RMW组件
sudo apt update
sudo apt install ros-$CHOOSE_ROS_DISTRO-rmw-opensplice-cpp # for OpenSplice
sudo apt install ros-$CHOOSE_ROS_DISTRO-rmw-connext-cpp # for RTI Connext (requires license agreement)
By setting the environment variable RMW_IMPLEMENTATION=rmw_opensplice_cpp you can switch to use OpenSplice instead. For ROS 2 releases Bouncy and newer, RMW_IMPLEMENTATION=rmw_connext_cpp can also be selected to use RTI Connext.
ros1-bridge
sudo apt update
sudo apt install ros-$CHOOSE_ROS_DISTRO-ros1-bridge
源代码安装
准备
sudo apt update && sudo apt install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-lark-parser \
python3-pip \
python-rosdep \
python3-vcstool \
wget
sudo apt install --no-install-recommends -y \
libasio-dev \
libtinyxml2-dev
sudo 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 \
pytest-repeat \
pytest-rerunfailures \
pytest \
pytest-cov \
pytest-runner \
setuptools
cd ./zsr_ws
wget https://raw.githubusercontent.com/ros2/ros2/crystal/ros2.repos
vcs import src < ros2.repos
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro crystal -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 python3-lark-parser rti-connext-dds-5.3.1 urdfdom_headers"
sudo python3 -m pip install -U lark-parser
编译
cd zsr_ws
colcon build --symlink-install --packages-ignore qt_gui_cpp rqt_gui_cpp
哈哈,colcon的这个构建系统还是挺高端的,跟zte的有的一拼!