The build folder contains caches, configurations, intermediate files, etc. generated when compiling CMake and catkin function packages.
The devel folder contains compiled executable programs that can be run directly without installation. Once the source code of the feature package is compiled and tested, these compiled executable files can be directly exported and shared with other developers.
A function package is the basic form of software organization in ROS. It has the minimum structure and content for creating a ROS program. It contains ROS node source code, scripts, configuration files, etc.
CMakeLists.txt is a feature package configuration file, which is used to compile the compilation configuration when compiling the Cmake feature package.
package.xml is a feature package manifest file, which uses XML format to mark various aspects of the feature package, such as the package name, developer information, dependencies, etc., mainly to make the installation and distribution of the feature package easier.
include/
The three folders msg, srv and action are used to store the definition files of non-standard topic messages, service messages and action messages respectively. ROS supports user-defined message types used in the message communication process. These custom messages are not necessary, for example, the program only uses standard message types.
The scripts directory stores script files such as Bash and Python and is not necessary.
The launch directory stores the startup files of the nodes. The *.launch files are used to start one or more nodes. They are very useful in large projects with multiple nodes and are not necessary.
The src directory stores the source code corresponding to the function package nodes. A function package can have multiple node programs to complete different functions, and each node program can run independently. The src directory stores the source code of these node programs. You can create folders and files as needed to organize the source code. The source code can be written in C++, Python, etc.
6.3. Understanding ROS architecture from the perspective of the open source community
ROS is open source software. Independent online communities share and contribute to the software, forming a powerful ROS open source community, as shown in the figure below.
The development of ROS relies on open source and shared software, which is shared and released by different organizations, such as GitHub source code sharing, Ubuntu software repository release, third-party libraries, etc. The official wiki of ROS is an important document discussion community, where you can easily publish and modify the corresponding document pages. The ROS answer homepage has a large number of questions and answers from ROS developers, and the discussion on various problems encountered in ROS development is very active.
7. Installation and testing of ROS
7.1. Update software sources
Before starting the installation, it is strongly recommended that you update the system source (many basic environment packages will be installed from here). I used Alibaba's source here, and the update method is as follows:
First you need to back up the original source list file
sudocp -/etc/apt/sources.list/etc/apt/sources.list.bak
Then start editing the source list file:
sudo gedit /etc/apt/sources.list
Delete the original contents in sources.list, then fill in the following contents and save:
debhttp://mirrors.aliyun.com/ubuntu/jammymainrestrictduniversemultiverse deb-srchttp://mirrors.aliyun.com/ubuntu/jammymainrestricteduniversemultiverse debhttp://mirrors.aliyun.com/ubuntu/jammy-securitymainrestricteduniversemultiverse deb-srchttp://mirrors.aliyun.com/ubuntu/jammy-securitymainrestricteduniversemultiverse debhttp://mirrors.aliyun.com/ubuntu/jammy-updatesmainrestricteduniversemultiverse deb-srchttp://mirrors.aliyun.com/ubuntu/jammy-updatesmainrestricteduniversemultiverse debhttp://mirrors.aliyun.com/ubuntu/jammy-proposeinrestricteduniversemultiverse deb-srchttp://mirrors.aliyun.com/ubuntu/jammy-proposedmainrestricteduniversemultiverse debhttp://mirrors.aliyun.com/ubuntu/jammy-backportsmainrestricteduniversemultiverse deb-srchttp://mirrors.aliyun.com/ubuntu/jammy-backportsmainrestricteduniversemultiverse
Note: Although they are all from the Ali source, there are different source versions for different systems. My Ubuntu system is the jammy version, and the Ali source should also be this version. Then update the software in your system according to this source:
sudo apt-get update sudo apt-getupgrade
This process should take quite a long time, but there should be no errors when it is completed. If there are task errors, please search on Baidu.
Then install ROS2 according to the official tutorial. The official installation tutorial link is as follows:
https://docs.ros.org/en/humble/Installation.html
7.2. Check the operating system language environment
In the official ROS2 documentation, you need to check the operating system language environment before installing ROS2. Official explanation: Make sure you have a language environment that supports U-8. If you are in a minimal environment (such as a Docker container), then the language environment may be minimal like POSIX. We check it with the following settings.
We can press Ctrl+Alt+T to call up the terminal and enter locale to check whether UTF-8 is supported. If not, you need to continue to execute the following instructions to set it:
locale#Check if UTF-8 is supported sudoaptupdate&&sudoaptinstalllocales sudolocale-genen_USen_US.UTF-8 sudoupdate-localeLC_ALL=en_US.UTF-8LANG=en_US.UTF-8 exportLANG=en_US.UTF-8 locale#Verify that the settings are correct
7.3、Ubuntu universe repository setup and startup
Before setting up the ROS2 software source, we need to first enable the Ubuntu universe repository. To enable the Ubuntu universe repository, we can do this through the command line by opening a terminal.
According to the official documentation, we can start the Ubuntu universe repository by entering the following command in the command line:
sudoaptinstallsoftware-properties-common sudod-apt-repositoryuniverse
7.4. Set up ROS software source
First add the ROS 2 apt repository updates to the system, then authorize the ROS 2 GPG key through apt, using the commands below:
sudoaptupdate&&sudoaptinstallcurl sudocurl-sSLhttps://raw.githubusercontent.com/ros/rosdistro/master/ros.key-o/usr/share/keyrings/ros-archive-keyring.gpg
Then add the repository to our sources list with the following instructions.
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"|sudotee/etc/apt/sources.list.d/ros2.list>/dev/null
7.5. Install ROS2
After setting up the repository, first update the apt repository cache by running the following command:
sudo apt update
Since ROS 2 is built on the frequently updated Ubuntu system, it is officially recommended to make sure your system is up to date before installing new packages. We can update the installed software with the following instructions:
sudo apt upgrade
ROS installation version selection and installation instructions:
ROS2 desktop version installation (official), including: ROS, Rviz, official demo, tutorial
sudoaptinstallros-humble-desktop
ROS2 basic version installation (bare metal), including: communication library, message package, command line tools, etc., but no GUI tools.
sudoaptinstallros-humble-ros-base
Here we install the desktop version of ROS2 and enter the following installation command:
sudoaptinstallros-humble-desktop
7.6 Environment Configuration
The official document gives the method of environment configuration. Before executing the ROS2 program in the terminal, you need to call the following command to configure the environment so that the program can be executed correctly.
#Replace".bash"withyourshellifyou'renotusingbash #Possiblevaluesare:setup.bash,setup.sh,setup.zsh source/opt/ros/humble/setup.bash
For the official environment configuration method, since each time a new terminal is opened, the environment needs to be configured, which reduces the efficiency of development and testing. In order to avoid this problem of environment configuration each time a new terminal is opened, we can write the configuration environment instructions into the "~/.bashrc" file through the following instructions, so that each time a new terminal is started, there is no need to manually configure the environment:
#Write the configuration environment instructions into the "~/.bashrc" file using the following instructions echo "source/opt/ros/humble/setup.bash">>~/.bashrc #View the "~/.bashrc" file sudogedit ~/.bashrc
So far, we have completed the installation and environment configuration of ROS2. Next, we will conduct environmental testing of ROS2.
8. Use cases of ROS operating system
8.1. Case 1 - talker and listener
We need to open two terminal windows and enter the following command in each.
Start the first terminal and start a data publisher node with the following command :
ros2rundemo_nodes_cpptalker
Start a second terminal and start a data subscriber node with the following command :
ros2rundemo_nodes_pylistener
Previous article:Pangu is here! China's first bridge-type explosion-proof heavy-load handling robot rolls off the production line
Next article:Transmission efficiency test of precision reducer for industrial robot
- Popular Resources
- Popular amplifiers
- Using IMU to enhance robot positioning: a fundamental technology for accurate navigation
- Researchers develop self-learning robot that can clean washbasins like humans
- Universal Robots launches UR AI Accelerator to inject new AI power into collaborative robots
- The first batch of national standards for embodied intelligence of humanoid robots were released: divided into 4 levels according to limb movement, upper limb operation, etc.
- New chapter in payload: Universal Robots’ new generation UR20 and UR30 have upgraded performance
- Humanoid robots drive the demand for frameless torque motors, and manufacturers are actively deploying
- MiR Launches New Fleet Management Software MiR Fleet Enterprise, Setting New Standards in Scalability and Cybersecurity for Autonomous Mobile Robots
- Nidec Drive Technology produces harmonic reducers for the first time in China, growing together with the Chinese robotics industry
- DC motor driver chip, low voltage, high current, single full-bridge driver - Ruimeng MS31211
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Help Post] High-frequency oscillation of high-frequency switching power supply current
- SHT31 Review - Unboxing and First Impressions
- IoT security himqtt firewall data structure ringbuffer ring buffer
- EEWORLD University Hall----Live Replay: TI's Latest Application of Millimeter-Wave Radar in the Automotive Field
- Changes in car rear lighting design
- EEWORLD University - Tektronix will teach you the oscilloscope usage skills you don't know
- [Download Gift] Demonstrate Multi-channel Signal Spectrum Analysis Using the Spectrum View Function of the New Tektronix MSO6 Oscilloscope
- Is there any MEMS or sensor expert?
- MSP430 Registers
- GPIO Features of TMS320C6748