官方参考文章
Ubuntu (Debian) — ROS 2 Documentation: Foxy documentation
curl密钥问题
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
添加DNS144.144.144.144
安装桌面版
sudo apt install ros-foxy-desktop python3-argcomplete
ros-foxy-desktop会含有ROS, RViz, demos, tutorials
运行talker-listener示例
source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_cpp talker
第二个
source /opt/ros/foxy/setup.bash
ros2 run demo_nodes_py listener
运行经典小乌龟
source /opt/ros/foxy/setup.bash
ros2 run turtlesim turtlesim_node
第二个窗口,把鼠标点在这个窗口,上下左右键可以控制小乌龟的移动
source /opt/ros/foxy/setup.bash
ros2 run turtlesim turtle_teleop_key
卸载
sudo apt remove ~nros-foxy-* && sudo apt autoremovesudo rm /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt autoremove
sudo apt upgrade
视频
Ubuntu20.04安装ROS2