As a software framework for mobile robots, ROS (robot operating system) has been widely used in recent years, but most applications are based on X86 architecture processors. How to combine such a powerful tool with the widely used ARM processor is a problem that many developers are eager to solve. As a beginner of ROS, I recently tried to transplant ROS to ARM. It took me four or five days, but I succeeded in the end.
Although there are some ROS application solutions for non-X86 architecture processors, such as eros (http://www.ros.org/wiki/eros) and rosserial (http://www.ros.org/wiki/rosserial), the latter is for Arduino. I played with the former for a few days but didn't understand how to use it, so I searched everywhere on the Internet and asked some people in the ROS group. Recently, someone in the group successfully compiled the ROS source code on MK802 III. So the original method of compiling the source code directly on the target machine, although less efficient, should be feasible.
Transplantation environment:
PC:Ubuntu 12.04
ARM processor: Cortex-A9
Arm operating system: Ubuntu12.04
ROS version: groovy
Compilation process:
1. Install tool software
Start the Ubuntu operating system in the ARM board, connect it to the computer via the serial port, and use SSH to remotely control the ARM board from the PC. Then you can control the code compilation in the ARM board on the PC.
First, follow the tutorial:
sudo apt-get install python-rosdep python-wstool build-essential
However, there are no python-rosdep and python-wstool packages in the Ubuntu source of arm. The installation of these two packages can be carried out according to the compilation instructions of fuerte (http://www.ros.org/wiki/fuerte/Installation/Ubuntu/Source):
python ez_setup.py
Install pip using easy_install: (http://www.ros.org/wiki/ROS/Installation/EasyInstallConfig)
sudo easy_install pip
Then install the following packages: (http://www.ros.org/wiki/fuerte/Installation/Ubuntu/Source)
sudo pip install -U rosdep
sudo pip install -U rosinstall
sudo pip install -U rospkg
Install python-wstool:
pip install -U wstool
redep initialization:
sudo rosdep init
rosdep update
2. Download source code
Create a folder:
mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws
Download the code. I used the smallest package ros-common:
wstool init src -j8 http://packages.ros.org/web/rosinstall/generate/raw/groovy/ros_comm
It is said that the rush for tickets during the Spring Festival travel rush brought down GitHub. At first, I couldn't connect to GitHub's server. I tried for a day before I finally downloaded the code in the midst of the rush for tickets. [page]
3. Compile source code
Install the dependency packages as described in the tutorial:
rosdep install --from-paths src --ignore-src --rosdistro groovy -y
Then you should also install cmake (I have already installed it before, I don't know if it should be installed in this step). I downloaded the source code from the official website (http://www.cmake.org/), and then compiled it on arm. The installation method refers to the link (http://hi.baidu.com/phpbooker/item/38ca262ed599d10c73863e05). The compilation on arm is too slow, it took nearly an hour. I don't know if it can be cross-compiled on PC, so I won't go into it.
The next step is the most important process - compilation. This process is painful and long. The main frequency of the arm board is slow. It takes about 20 minutes to compile the code once. Moreover, each error always occurs after a long time of compilation. Various dependent packages need to be installed. If you compile now, there will definitely be a lot of errors. You can deal with them step by step according to these errors. Basically, the dependent packages are not installed. The most important one is the boost library package. Because a lot of code in ROS is written in C++ and uses boost static libraries, the boost library must be installed in the ubuntu system in the arm. The boost library is the problem that I have been struggling with for the longest time. I have used various methods to install it:
(1) Direct apt-get installation
(2) Download the source code, cross-compile it on the PC, and then put it into the arm
(3) Directly download the official deb package compiled for the arm architecture and install it (https://launchpad.net/ubuntu/+source/boost1.46/1.46.1-7ubuntu3/+build/3060825)
As for the version of boost library, I have tried many, from 1.40 to 1.52, and finally the third method is reliable. After the first two methods are installed, they always report an error during the compilation process saying that a library in boost cannot be found. Open the link above, there will be a list of boost libraries:
I downloaded and installed all the above packages one by one, and they are basically interdependent. There may still be some other dependent packages during the installation process, which can be installed using pip or easy_install.
So far, we can finally start compiling and installing:
./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/groovy
If everything goes well, the installation will be completed in minutes.
Add environment path:
source /opt/ros/groovy/setup.bash
echo "export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH" >> ~/.bashrc
echo "export ROS_WORKSPACE=~/ros_workspace" >> ~/.bashrc
. ~/.bashrc
Finally the installation is complete, enter "roscore" in the terminal to see if it runs normally. At this step, I got an error:
what(): locale::facet::_S_create_c_locale name not valid
Later I used Google to solve it (http://cruisever.blog.163.com/blog/static/786117572010817112310741/), adding:
export LC_ALL="C"
Finally it works fine. I did a simple test of the talker and listener, everything is working fine, although it is a bit slow, but the initial transplant should be completed, there should be more problems waiting for me later.
Previous article:ARM-based multiplayer gaming platform
Next article:Design of human-machine interface for three-axis servo control system based on ARM
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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
- Avoiding ESD and EMI in mobile audio systems
- Lithium battery 4.2V step-up and step-down to 0-50V,
- Thank you for being there - Tribute to my love
- Fluke High Resolution Thermal Imager - Even the smallest details are captured! Free trial registration is open
- The capacitor on the PCBA cracked and short-circuited. How could it be the design's fault?
- 【Bluesun AB32VG1 RISC-V Evaluation Board】Development of example programs
- 2nd day to go!! Pre-registration for the prize live broadcast | ON Semiconductor image sensors help the automotive, machine vision and artificial intelligence fields....
- 【AT-START-F425 Review】USB to CAN Preview Post
- Abnormal sound from the front transformer of the power factor circuit
- Packaging issues of double-row pluggable connectors