|
| 1 | + |
| 2 | +# Software Installation |
| 3 | + |
| 4 | +## OS and ROS versions |
| 5 | + Ubuntu 22.04 |
| 6 | + ROS2 Humble |
| 7 | + |
| 8 | +## Ubuntu 22.04 Installation guide |
| 9 | + |
| 10 | +[Installation Guide](https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview) |
| 11 | + |
| 12 | +## Ros2 humble Installation guide |
| 13 | + |
| 14 | +### 1. Set locale: |
| 15 | + Make sure you have a locale which supports “UTF-8”. For this try the following commands. |
| 16 | + |
| 17 | +```bash |
| 18 | +locale # check for UTF-8 |
| 19 | + |
| 20 | +sudo apt update && sudo apt install locales |
| 21 | +sudo locale-gen en_US en_US.UTF-8 |
| 22 | +sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 |
| 23 | +export LANG=en_US.UTF-8 |
| 24 | + |
| 25 | +locale # verify settings |
| 26 | +``` |
| 27 | + |
| 28 | +### 2. Setup Sources: |
| 29 | +You will need to add the ROS 2 apt repository to your system. |
| 30 | + |
| 31 | +First ensure that the Ubuntu Universe repository is enabled |
| 32 | + |
| 33 | +```bash |
| 34 | +sudo apt install software-properties-common |
| 35 | +sudo add-apt-repository universe |
| 36 | + |
| 37 | +``` |
| 38 | +Now add the ROS 2 GPG key with apt. |
| 39 | + |
| 40 | +```bash |
| 41 | +sudo apt update && sudo apt install curl -y |
| 42 | +sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg |
| 43 | + |
| 44 | +``` |
| 45 | +Then add the repository to your sources list. |
| 46 | + |
| 47 | +```bash |
| 48 | +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null |
| 49 | + |
| 50 | +``` |
| 51 | +### 3.Install Ros2 packages |
| 52 | +Update your apt repository caches after setting up the repositories. |
| 53 | + |
| 54 | +```bash |
| 55 | +sudo apt update |
| 56 | +``` |
| 57 | +ROS 2 packages are built on frequently updated Ubuntu systems. It is always recommended that you ensure your system is up to date before installing new packages. |
| 58 | + |
| 59 | +```bash |
| 60 | +sudo apt upgrade |
| 61 | +``` |
| 62 | +Desktop Install |
| 63 | +```bash |
| 64 | +sudo apt install ros-humble-desktop |
| 65 | +``` |
| 66 | +### 4. Environment Setup: |
| 67 | +Set up your environment by sourcing the following file. |
| 68 | +```bash |
| 69 | +source /opt/ros/humble/setup.bash |
| 70 | +``` |
| 71 | +Automatically add ROS environment variables to your bash session every time a new shell terminal/bash is launched, enter the following command. |
| 72 | +```bash |
| 73 | +echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc |
| 74 | +``` |
| 75 | +Sourcing bashrc ensures to use updated bashrc using the following command, or it can be done by closing all terminals and re-opening a new terminal. |
| 76 | +```bash |
| 77 | +source ~/.bashrc |
| 78 | +``` |
| 79 | +## Installation check |
| 80 | + |
| 81 | +In one terminal, source the setup file and then run a C++ talker: |
| 82 | +```bash |
| 83 | +ros2 run demo_nodes_cpp talker |
| 84 | +``` |
| 85 | + |
| 86 | +In another terminal source the setup file and then run a Python listener: |
| 87 | +```bash |
| 88 | +ros2 run demo_nodes_py listener |
| 89 | +``` |
| 90 | +You should see the talker saying that it’s publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly. |
| 91 | + |
| 92 | + |
| 93 | +``` |
| 94 | +
|
| 95 | +
|
0 commit comments