Ubuntu 22.04 Configuring ROS2 Humble

I. Introduction

This series of articles is the author in the process of self-taught ROS records, due to the installation of dual-system switching is more troublesome, I used a virtual machine approach!

 

Ubuntu installation

① virtual machine approach

1. Download and install the virtual machine

VMware16 is a super-powerful computer virtual machine software, through this software, we can run on the original system and then other operating systems, including Windows, Linux, etc., the first to download and install the virtual machine, do not provide download resources!

 

2. Download Ubuntu22.04 image

Ubuntu22.04LTS-amd64

Ubuntu22.04LTS-RaspberryPi

 

3.Install Ubuntu22.04 in VMware

Create a new virtual machine in VMware, and select the downloaded ubuntu-22.04-desktop-amd64.iso image file.

Choose the options according to your own needs, I use AMD CPU need to enable AMD-V function in the bios to use the virtual machine function.

If there are other errors, follow the error tips on Baidu to find the error information to do changes

 

② disk burning method

1. Prepare microSD card

2. Download the Ubuntu image

Ubuntu22.04LTS-amd64

Ubuntu22.04LTS-RaspberryPi

 

3.Use balenaEtcher to burn the image to microSD card.

4. Insert the Raspberry Pi and other devices to boot up and use it

Ubuntu environment configuration

0. Modify the display settings (for independent screen devices)

Add the following to config:

(to micro-snow 5inch HDMI AMOLED as an example, other screen device configuration is different, you need to consult the specific manufacturer)

 

hdmi_force_hotplug=1

config_hdmi_boost=10

disable_overscan=1

hdmi_group=2

hdmi_mode=87

hdmi_timings=960 0 190 4 32 544 0 10 10 12 0 0 0 0 60 0 41000000 3

1. disable sudo password

The sudo command is often used at the command line. Turning off the sudo password eliminates the need to enter it every time.

Ctrl+Alt+T to open the terminal.

Type the command sudo visudo in the terminal to open visudo;

 

sudo visudo

Find the line %sudo ALL=(ALL:ALL) ALL in the text.

Change it to %sudo ALL=(ALL:ALL) NOPASSWD:ALL

 

%sudo ALL=(ALL:ALL) NOPASSWD:ALL

2. Configure the network environment (VM only)

Virtual machine environment network often have problems, showing no wifi adapter, here to windows as an example, open the 'Network and Internet Settings' ¡ú Change Adapter Options ¡ú Select WLAN and right-click ¡ú Open Properties ¡ú Check 'Sharing', check 'Sharing', and then click on 'Sharing'. ', check 'Allow users from other networks to connect through this computer's Internet', and select VMware Network Adapter in 'Home Network Connection' below. VMnet8

Switch to VMware, open 'Edit' in the upper left corner, open 'Virtual Network Editor', select 'Bridge Mode', and select your own local adapter

If using Ethernet wired connection can be ignored (2. Configure the network environment)

 

3. Modify the source

sudo gedit /etc/apt/sources.list

Backup the contents and modify it to

 

# This image only contains packages for 32/64-bit x86 architecture processors, on ARM (arm64, armhf), PowerPC (ppc64el), RISC-V (riscv64), and S390x architecture devices (corresponding to the official source of ports.ubuntu.com) please use the ubuntu-ports image. ubuntu-ports mirrors.

# The source image is commented out by default for faster apt updates, but you can uncomment it if you need to.

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

 

# deb  jammy-proposed repositories, not recommended

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

If the device is an arm architecture processor such as a Raspberry Pi, change the content to ubuntu-ports

Check the architecture with the following command

 

uname -a

# The source image is commented out by default to improve the speed of apt update, but you can uncomment it if you need to

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse

 

# deb  jammy-proposed repositories, not recommended

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse

Optional one-click source change:

 

sudo sed -i “s#ports.ubuntu.com#mirrors.ustc.edu.cn#g” sources.list

4. Update the software

Check for updates by running in the terminal

 

sudo apt update

Then run update

 

sudo apt upgrade

5. Other Configurations

Install PIP

 

sudo apt install pip

Configure pip source

 

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

Configure github acceleration

 

sudo apt install cgit

git config --global url. “https://gitclone.com/”.insteadOf https://

Install the command-line management tool terminator

 

sudo apt install terminator

Install the screensaver

 

sudo apt-get install xscreensaver

Install screen recorder

 

sudo add-apt-repository ppa:obsproject/obs-studio

sudo apt-get update

sudo apt-get install obs-studio

obs

Install WeChat

 

Wine environment package download

 

WeChat (wine) package download

 

Execute the following in the download directory

 

sudo dpkg -i ukylin-wine_70.6.3.25_amd64.deb

sudo dpkg -i ukylin-wechat_3.0.0_amd64.deb

Install ROS

①Install ROS1 Noetic (only need ROS2 can be skipped)

If you need to install ROS1 Noetic

 

1, add the software source-sources.list

 

sudo sh -c 'echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list'

2. Add the key

 

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3. Update the repositories

 

sudo apt update

4. Install the full desktop version: includes ROS, rqt, rviz, Robotics Common Library, 2D/3D Simulator, Navigation, and 2D/3D Perception.

 

sudo apt install ros-noetic-desktop-full

5. After installation, run it again to unpack it

 

sudo apt install ros-noetic-desktop-full

6. Initialize rosdep (rosdep is used to resolve feature pack installation system dependencies and is a required component of ROS)

 

sudo rosdep init

rosdep update

First install pip and install rosdepc

 

sudo apt-get install python3-pip

sudo pip install rosdepc

Then use the domestic version of rosdepc

 

sudo rosdepc init

rosdepc update

6. Setting environment variables (bash)

Since you will be typing the ros command in the terminal frequently, set the environment variables for easy use later on

 

echo “source /opt/ros/noetic/setup.bash” >> ~/.bashrc

source ~/.bashrc

7. Test

ROS environment has been configured, open a core test can not enter, if you want to test a little more can run a turtle

 

roscore

② Install ROS2 Humble

Install ROS2 Humble with one click:

 

wget http://fishros.com/install -O fishros && . fishros

Manual installation:

1. Add the software source -sources.list

 

echo “deb [arch=$(dpkg --print-architecture)] https://repo.huaweicloud.com/ros2/ubuntu/ $(lsb_release -cs) main” | sudo tee /etc/apt/sources. list.d/ros2.list > /dev/null

2. Add the key

 

sudo apt install curl gnupg2 -y

curl -s https://gitee.com/ohhuo/rosdistro/raw/master/ros.asc | sudo apt-key add -

3. Update the repository

 

sudo apt update

4. Install the full version of the desktop

 

sudo apt install ros-humble-desktop

5. Install other dependencies

 

sudo apt install python3-argcomplete -y

6. Configure ROS environment variables

 

echo “source /opt/ros/humble/setup.bash” >> ~/.bashrc

7. Initialize rosdep (rosdep is used to resolve feature pack installation system dependencies and is a required component of ROS)

 

sudo pip install rosdepc

Then use the domestic version of rosdepc

 

sudo rosdepc init

rosdepc update

For some newly created workspace, if you wish to add to the environment variable, you can use:

 

echo “source /home/ubuntu/ros2_ws/install/setup.bash” >> ~/.bashrc

/home/ubuntu/ros2_ws/ is the path to the workspace.

 

pwd # View the current path

Privacy    |    Terms of use