当前位置:网站首页>Introduction to ROS learning notes (II)
Introduction to ROS learning notes (II)
2022-04-23 18:40:00 【Why is it so difficult to name?】
ROS Introduction notes ( Two )
Start
The last installation completed dual systems and ROS operating system , Before I start learning theory , Try to understand a simulation project .
ROS-Academy-for-Beginners
website : https://github.com/DroidAITech/ROS-Academy-for-Beginners.git
This is a Chinese University MOOC The source code provided in the introduction course of robot operating system , This blog is based on the lecture notes , If there is something wrong , Please correct .
You can't take a bus before you learn to drive .
Download source package
- stay Ubuntu On the system , Make sure git Is already installed
$ sudo apt-get install git
- Then create a file named tutorial_ws Working space for , In its src Clone under path ROS-Academy-for-
Beginners software package
$ cd
$ mkdir -p tutorial; # establish catkin working space
$ cd tutorial_ws/src # Get into src route , Clone teaching software package
$ git clone https://github.com/DroidAITech/ROS-Academy-for-Beginners.git
- Wait for the installation to complete
Installation dependency
install ROS-Academy-for-Beginners The dependence needed
$ cd ~/tutorial_ws
$ rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
Be careful : The above command is very important , Lack of dependencies will cause the software package to fail to compile and run normally .
Before you start compiling , Need to ensure Gazebo stay 7.0 Above version
$ gazebo -v # confirm 7.0 And above
If your Gazebo Version below 7.0, You need to upgrade
$ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
$ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install gazebo7
compile
Then go back to catkin_ws Compile below
$ cd ~/tutorial_ws
$ catkin_make
$ source ~/tutorial_ws/devel/setup.bash # Refresh the environment Method 1
$ rospack profile # Refresh the environment Method 2
Be careful :source command , After compiling, you must refresh the environment of the workspace , Otherwise, you may not find a workspace . Many times we can run the compiled in the workspace in order to open the terminal ROS Program , Usually put source ~/tutorial_ws/devel/setup.bash
The command is appended to ~/.bashrc
In file , So every time you turn on the terminal , The system will refresh the workspace environment . Can pass echo "source~/tutorial_ws/devel/setup.bash" >> ~/.bashrc
Command to append .
Run the simulation program
After compiling, you can run the simulation , Input
$ rospack profile
$ roslaunch robot_sim_demo robot_spawn.launch
You will see the simulation screen start , The simulation interface includes software Museum and Xbot Robot models .
You can drag around , You can zoom in and see the details The aerial view is as follows :
Open a new terminal , Enter the following command , Use the keyboard to control the robot to move
$ source ~/tutorial_ws/devel/setup.bash
$ rosrun robot_sim_demo robot_keyboard_teleop.py
Focus control program window , Press down i、j、l Wait for the button , So you can control the movement of the robot through the keyboard .
This is the end of the experience !( So this is the big man's world )
I really want to learn after taking a bus ROS 了 !
Possible problems
I'm opening gazebo When the door cannot be opened , Stuck in "Preparing your world"
Solution :
1. upgrade gazebo( ditto )
$ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
$ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install gazebo7
2.model The library cannot be opened due to incorrect loading , Then download all models to... Under the user's root directory .gazebo/models
$ cd ~/.gazebo/
$ mkdir -p models
$ cd ~/.gazebo/models/
$ wget http://file.ncnynl.com/ros/gazebo_models.txt
$ wget -i gazebo_models.txt
$ ls model.tar.g* | xargs -n1 tar xzvf
版权声明
本文为[Why is it so difficult to name?]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210609243534.html
边栏推荐
- Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
- Machine learning practice - naive Bayes
- Multifunctional toolbox wechat applet source code
- Iptables - L executes slowly
- Résolution: cnpm: impossible de charger le fichier... Cnpm. PS1 parce que l'exécution de scripts est désactivée sur ce système
- STM32: LCD display
- Promote QT default control to custom control
- Quantexa CDI(场景决策智能)Syneo平台介绍
- QT error: no matching member function for call to ‘connect‘
- 纠结
猜你喜欢
iptables初探
ESP32 LVGL8. 1 - arc (arc 19)
os_authent_prefix
How to restore MySQL database after win10 system is reinstalled (mysql-8.0.26-winx64. Zip)
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
Practice of Druid SQL and security in meituan review
QT tablewidget insert qcombobox drop-down box
教你用简单几个步骤快速重命名文件夹名
Summary of actual business optimization scheme - main directory - continuous update
listener.log
随机推荐
Cutting permission of logrotate file
Introduction to quantexa CDI syneo platform
Database computer experiment 4 (data integrity and stored procedure)
SQL中函数 decode()与 replace()的用法
【科普】CRC校验(一)什么是CRC校验?
ESP32 LVGL8. 1 - input devices (input devices 18)
ctfshow-web361(SSTI)
STM32: LCD显示
Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
QT notes on qmap container freeing memory
ctfshow-web361(SSTI)
Daily network security certification test questions (April 14, 2022)
程序员如何快速开发高质量的代码?
os_ authent_ Prefix
os_authent_prefix
机器学习理论基础篇--关于机器学习的一些术语
Loop path
Teach you to quickly rename folder names in a few simple steps
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
Serial port debugging tools cutecom and minicom