1.设置编码
apt update && apt install locales locale-gen en_US en_US.UTF-8 update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 export LANG=en_US.UTF-8
2.添加源
apt update && apt install curl gnupg lsb-release curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
3. 安装ROS2
apt update apt upgrade apt install ros-humble-desktop
## 如果ros-humble-desktop无法下载使用,可以使用ros-poxy-desktop
4. 设置环境变量
source /opt/ros/humble/setup.bash echo " source /opt/ros/humble/setup.bash" >> ~/.bashrc
5.ROS2示例测试
ros2 run demo_nodes_cpp talker ros2 run demo_nodes_py listener
6.小海龟仿真示例
启动两个终端,分别运行如下指令:
ros2 run turtlesim turtlesim_node ros2 run turtlesim turtle_teleop_key
标签:en,UTF,apt,US,测试,Ubuntu,ros,ros2 From: https://www.cnblogs.com/databank/p/18009163