Ubuntu20.04 ROS2 安装
安装
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 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=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
# 再次更新即可
sudo apt update
sudo apt install ros-foxy-desktop
#安装自动补全工具
sudo apt install python3-argcomplete
测试
source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_cpp talker
#再开启一个终端
source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_py listener
ROS2的RWM默认使用的DDS是Fast RTPS,Cyclone DDS默认也安装好了,还可以这样安装RTI Connext:
sudo apt update
sudo apt install ros-foxy-rmw-connext-cpp # for RTI Connext (requires license agreement)
安装之后通过环境变量即可切换DDS:
RMW_IMPLEMENTATION=rmw_connext_cpp
RVIZ 使用
rviz 使用 demo
https://www.guyuehome.com/2337
实例程序
安装编译工具
rviz 画点线的程序
http://wiki.ros.org/rviz/Tutorials/Markers%3A%20Points%20and%20Lines