B2:Thêm key cho ROS
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
B3:cập nhật
sudo apt update
B4:Cài đặt gói ROS
sudo apt install ros-melodic-desktop-full
Chọn Y để tiếp tục.
Các gói phụ :
sudo apt install ros-melodic-desktop
sudo apt install ros-melodic-base
sudo apt install ros-melodic-core
Thiết lập môi trường cài đặt
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Chạy lệnh kiểm tra hoạt động :tail ~/.bashrc
Tiếp theo cài đặt gói ROS
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
Cài đặt gói rosdep
sudo apt install python-rosdep
sudo rosdep init rosdep update
sudo apt install python-roslaunch
mở Terminal 1 chạy :roscore
mở Terminal 2:
rosrun turtlesim turtlesim_node
Nếu cài đặt thành công sẽ hiện thị như sau:
Mở tiếp Terminal 3:
rosrun turtlesim turtle_teleop_key
Dùng phím lên xuống và sang trái phải chạy rùa các bạn nhé .
Cảm ơn các bạn đã ghé thăm shop .
Các bạn tham khảo thêm
https://www.intorobotics.com/installing-ros-melodic-on-raspberry-pi-3b-running-ubuntu-mate-18-04-2-bionic/