News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

no classification

tag  

no tag

date  

2024-11(9)

ROS development environment construction (2024.8.4)

posted on 2024-11-02 13:56     read(628)     comment(0)     like(21)     collect(5)


Table of contents

1.ROS installation process

2.PRACTICAL INSTALLATION OF ROS ENVIRONMENT

2.1 Install Virtualbox

2.2 Create a virtual host on the virtual machine software

​Edit 2.3 Ubuntu installation

3. Software environment configuration

3.1 Installing virtual machine tools

3.2 Testing virtual machine tools 

 3.3 Installing the file exchange tool

​Edit 3.4 Install extensions

​Edit 3.5 Optimization

4. ROS Installation

 4.1 Configure Ubuntu software and updates

 4.2 Setting up the installation source

4.3 Setting Key 

​Edit 4.4 Installation

4.5 ROS Installation

4.6 Configure environment variables:


1. ROS installation process

    Installation method: physical machine installation, virtual machine installation (used in this article)

    The virtual machine follows the process 1. Install the virtual machine software

                               2. Use virtual machine software to virtualize a host

                               3. Install Ubuntu 20.04 on a virtual machine

                               4. Install ROS on Ubuntu

                               5. Test whether ROS is running normally

2.PRACTICAL INSTALLATION OF ROS ENVIRONMENT

2.1 Install Virtualbox

website:

https://www.virtualbox.org/wiki/Downloads

After entering the website, click Downloads → Select the installation environment → Extension plug-in (All-supported platforms)

There are no special requirements during the installation process. You can keep pressing Next.

 

After the installation is complete, there will be an icon on the desktop

2.2 Create a virtual host on the virtual machine software

Open VirtualBox and click New

The virtual machine name and folder path can be customized. The operating system is Linux , and the version is Ubuntu 64-bit.

Configure the virtual machine memory - 2G or more is recommended, and choose 2-3 processors , depending on your hardware, but it is best to start with 2.

When creating a virtual hard disk, it is recommended to create a larger space, 60G is recommended, otherwise it will be difficult to use later.

The virtual machine will not occupy memory when it is not started, but subsequent installation files will need to occupy the virtual machine's memory. It is recommended to give it a larger size when configuring.

 

Click Finish to create successfully:

After successful creation, VirtualBox will display a virtual machine

2.3 Ubuntu installation

Install Ubuntu image file 

Installation link: http://mirrors.aliyun.com/ubuntu-releases/20.04/

After jumping to the link, select the image file ubuntu-20.04-desktop-amd64.iso to download

Associate with the downloaded image file

Click on the virtual machine settings → Storage → Click on No Blue Disk → Select Virtual Disk → Select CD

 Select the image file you just downloaded and click OK

 After completing the above steps, you can click the green start button on VirtualBox

Startup completed (no pop-up window in the new version)

 Click on the left side to set the language to Chinese (Simplified), and select Install Ubuntu on the right side

 After clicking Install, select Chinese for the keyboard layout, as shown in the picture, and the Continue button is not displayed.

Press Alt+F7

Continue to the next step.

 continue

Install Now

 Click Continue

continue

 

Set the device account name, password, etc., select Automatic login, and then click Continue.

Wait for installation (installation takes a long time) about 10 minutes (you can click Skip to skip)

The installation is successful, click Restart Now.

It will prompt you to remove the installation disk and press Enter. Just press Enter

The screen will go black for a while and then display the Ubuntu interface

Click Skip, Go Forward → Select No → Go Forward → Go Forward → Done.

 This completes the installation of the Ubuntu operating system.

3. Software environment configuration

3.1 Installing virtual machine tools

Click on the device and select Install Enhancements

Click Run and enter the password

 When the installation is complete, you will be prompted to press return to close this window. Click Enter to close it.

 Click Shutdown and restart the Ubuntu system to make the tool take effect.

3.2 Testing virtual machine tools 

Click on the view and select the automatic zoom mode

 Basic commands Right Ctrl+F: Full screen display

                Right Ctrl+C: Zoom display

 3.3 Installing the file exchange tool

Open VirtualBox, click Settings, and configure it as shown below.

Click the file of Ubuntu system, open it, drag the txt format notepad on Windows into the test, and if it is successfully dragged in, it means that the file exchange tool has been installed (if it fails once, you can restart and try again)

 3.4 Install extension plugins

Open the VirtualBox virtual machine, click Manage → Click Tools → Click Expansion Pack

Click Install, and the installation will be completed as shown in the figure

 3.5 Optimization

Configuration Text Document

Click the home directory → click the template → right click → open in terminal

Input: sudo gedit create a new text document.text

Enter

Enter password

Enter

keep

Click on the home directory and right click to see the option of creating a new document

Tip: "Win+Space" can switch between Chinese and English

           The password input status will not be displayed when entering the password: the password entered is the power-on password

4. ROS Installation

 4.1 Configure Ubuntu software and updates

First open the "Software and Updates" dialog box

Confirm that the first four are checked and close.

 4.2 Setting up the installation source

The installation source is the official default:

Installing the installation sources of Tsinghua University or USTC may cause errors in subsequent steps, so we will not use those two installation sources here.

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

 On the virtual machine, press "Ctrl+Alt+T" to open the control interface, paste the installation source, press Enter, and enter the password.

4.3 Setting Key 

Copy Key

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

Paste the Key 

 4.4 Installation

Update apt

sudo apt update

 Continue copying and wait for the download to complete.

4.5 ROS Installation

Wait for the previous step to complete the installation and enter the following command

sudo apt install ros-noetic-desktop-full 

 Enter "Y" and press Enter, then wait for the download. The download time depends on the network. Mine took about 15 minutes.

4.6 Configure environment variables:

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

source ~/.bashrc

After entering the password, enter the two

4.7 Install build dependencies,

Open the console and enter the following command

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo apt install python3-rosdep

Press Enter

Type "clear"

Enter

test:

Enter Ctrl+Alt+T to open three command lines in succession and enter the following three commands respectively

Command line 1 input: roscore

Command line 2 enters: rosrun turtlesim turtlesim_node

Command line 3 enter again: rosrun turtlesim turtle_teleop_key

Place the mouse on the third command line, and use the arrow keys to control the turtle. Press "q" to exit.



Category of website: technical article > Blog

Author:kimi

link:http://www.pythonblackhole.com/blog/article/245798/86ea7a939836242e8ba2/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

21 0
collect article
collected

Comment content: (supports up to 255 characters)