当前位置:网站首页>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
边栏推荐
- Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
- Domestic GD chip can filter
- Go 语言 GUI 框架 fyne 中文乱码或者不显示的问题
- Ucosiii transplantation and use, reference punctual atom
- SQL database syntax learning notes
- Daily CISSP certification common mistakes (April 13, 2022)
- 【科普】CRC校验(一)什么是CRC校验?
- 昇腾 AI 开发者创享日全国巡回首站在西安成功举行
- CANopen STM32 transplantation
- Ionic 从创建到打包指令集顺序
猜你喜欢
7、 DOM (Part 2) - chapter after class exercises and answers
昇腾 AI 开发者创享日全国巡回首站在西安成功举行
QT add external font ttf
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
玻璃体中的硫酸软骨素
os_ authent_ Prefix
七、DOM(下) - 章节课后练习题及答案
ctfshow-web361(SSTI)
Machine learning practice - naive Bayes
STM32 learning record 0008 - GPIO things 1
随机推荐
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
ctfshow-web362(SSTI)
迁移学习进阶
机器学习理论之(8):模型集成 Ensemble Learning
数据库上机实验四(数据完整性与存储过程)
Daily CISSP certification common mistakes (April 14, 2022)
Chondroitin sulfate in vitreous
ESP32 LVGL8. 1 - bar progress bar (bar 21)
Can filter
Nacos集群搭建和mysql持久化配置
Iptables - L executes slowly
机器学习理论基础篇--关于机器学习的一些术语
Introduction to QT programming
Keil RVMDK compiled data type
Feature selection feature_ selection--SelectKBest
ESP32 LVGL8. 1 - textarea text area (textarea 26)
Ctfshow - web362 (ssti)
Machine learning theory (8): model integration ensemble learning
特征选择feature_selection--SelectKBest
Daily network security certification test questions (April 18, 2022)