Ubuntu environment configuration guide (with ROS and SLAM operating environment)

Ubuntu environment configuration guide (with ROS and SLAM operating environment)

Summary: A summary of the experience of installing and uninstalling Ubuntu many times. It can be used as an introductory environment configuration tutorial. It is compiled with reference to many links.

1. Ubuntu system installation (20.04)

1. Prepare system disk

  • Download mirror, mirror station address: http://mirrors.aliyun.com/ubuntu-releases/20.04/​ Download ubuntu-20.04.4-desktop-amd64.iso
  • Prepare an empty USB flash drive, 8G or more. After right-clicking to format it, use SoftDisk or Rufus to create a system boot disk. Refer to link, first refer to the link for making a system disk. The steps here are basically the same.
  • After the writing is completed, the name of the USB flash drive will generally change back to the corresponding system version. You can also check the system version from the readme or info file.

2. System installation

Notice:

If it is a dual-system installation, first refer to the disk partition section in the above referencelink, or you can directly buy a mechanical hard drive.

In addition, when entering the BIOS interface, different computers may have different entry methods. You need to check online. The main steps are to turn off security/fast startup (this will make the system start with windows by default), and set the startup item to boot from a USB disk. . Refer to Link 1 and Link 2; just refer to the BIOS settings section first .

If you don't have a Windows system installed, you don't need to set it up like this, just plug in the USB flash drive.

  • Insert the USB flash drive, start the computer, and select the second option to install Ubuntu. Start the installation later, select the language, do not need to be connected to the Internet, and choose normal installation.The key point later is to select other options. If it is a virtual machine, it is not a big problem. .
    Insert image description here
    Insert image description here

  • Hard disk partitioning method 1 can refer to the partition part of this link. Note that you need to select the disk that was partitioned before. Personally, I recommend the mount point " \"Can be larger.

  • Hard disk partitioning method 2 can only set three partitions.

    • EFI system partition (primary partition) 512M
    • Swap space (logical partition) 16000M (twice the memory size)
    • Mount point/​ (primary partition) All remaining capacity
    • Ubuntu also needs to be installed on the laptop, and version 20.04 is recommended. Virtual machines or dual systems are acceptable. If you plan to study for a long time, dual systems are recommended.

Insert image description here

  • After the partitioning is completed, just install it normally. If you encounter bugs during the installation process, search for them. Basically, others you have encountered have also encountered them. Try to read a few comprehensive considerations, otherwise you may encounter unexpected errors.

2. SLAM environment configuration

Personally, it is recommended to configure the SLAM environment first, refer to the environment installation in Visual SLAM14, and then install the ROS system. If there is no need for SLAM learning, just install ROS directly.

  • To change the source, you can change it in software and updates, or you can refer to this link To change the source and build the environment, just refer to the build environment. .

Insert image description here

  • Mainly install CMake, Git, g++ compiler, etc.

    sudo apt-get install g++
    sudo apt-get install cmake
    sudo apt-get install git
    sudo apt-get install git
    
  • Then install Eigen, pangolin, OpenCV, Ceres, g2o, DBoW3, PCL, octomap, etc., just follow the previous link and visual SLAM14.

  • Problems you may encounter:

    • pangolin, reference connection

      terminate called after throwing an instance of 'std::runtime_error'
      what():  Pangolin X11: Unable to retrieve framebuffer options
      
    • octomap: Reference Connection

    • eigen: The default installation is version 3.3. Different open source algorithms may encounter eigen version inconsistencies. You can search for how to install multiple versions of eigen. You can also contact me if you need it.

    • sophus: ReferenceLink

    • The ceres version is better to be higher, 1.14.0 reference

    • opencv installs VIZ module, refer tolink

    • PCL and opencv may involve the need to install multiple different versions, refer toLink 1, Link 2.

  • To configure Vscode, you can refer to this link. You need to install some C++ plug-ins. After setting up CmakeLists, you don’t need to write a json file. Select the kit. , just compile with one click.
    Insert image description here

3. ROS system installation

The ROS version corresponding to Ubuntu20.04 is noetic. For different versions, please refer to the link.

  • ROS installation

    • sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    • sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
    • sudo apt update
    • sudo apt install ros-noetic-desktop-full
    • echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
    • It is recommended that students who have no ROS foundation first go to Station B to learn the ROS introductory tutorial by Teacher Gu Yue.
  • Possible problems:

    • There are several software packages that cannot be downloaded. Add --fix-missing to complete the remaining installation.
    • For other questions, please refer to Baidu. Some tutorials have rosdep or failed initialization connections. Generally, you need to circumvent the firewall. You can also directly download the corresponding yaml file and copy it to the corresponding directory yourself.
  • Test ROS

    • Open three terminals and enter respectively
    • roscore
    • rosrun turtlesim turtlesim_node
    • rosrun turtlesim turtle_teleop_key

Guess you like

Origin blog.csdn.net/qq_43377917/article/details/130948478