当前位置:网站首页>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
边栏推荐
- Ctfshow - web362 (ssti)
- Multifunctional toolbox wechat applet source code
- ESP32 LVGL8. 1 - BTN button (BTN 15)
- CISSP certified daily knowledge points (April 11, 2022)
- In win10 system, all programs run as administrator by default
- 14个py小游戏源代码分享第二弹
- Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
- QT tablewidget insert qcombobox drop-down box
- C language simulates entering and leaving the stack, first in first out, first in first out, shared memory
- Keil RVMDK compiled data type
猜你喜欢
CANopen STM32 transplantation
iptables -L执行缓慢
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
7、 DOM (Part 2) - chapter after class exercises and answers
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
Query the logistics update quantity according to the express order number
os_ authent_ Prefix
ESP32 LVGL8. 1 - slider slider (slider 22)
ESP32 LVGL8. 1 - textarea text area (textarea 26)
On iptables
随机推荐
配置iptables
实战业务优化方案总结---主目录---持续更新
[popular science] CRC verification (I) what is CRC verification?
Ctfshow - web362 (ssti)
iptables初探
CISSP certified daily knowledge points (April 19, 2022)
CANopen usage method and main parameters of object dictionary
STM32 learning record 0008 - GPIO things 1
Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
iptables -L执行缓慢
Nacos作为服务配置中心实战
深入理解 Golang 中的 new 和 make 是什么, 差异在哪?
Daily CISSP certification common mistakes (April 11, 2022)
WiFi ap6212 driver transplantation and debugging analysis technical notes
Daily network security certification test questions (April 18, 2022)
How to restore MySQL database after win10 system is reinstalled (mysql-8.0.26-winx64. Zip)
Seata handles distributed transactions
七、DOM(下) - 章节课后练习题及答案
Quantexa CDI(场景决策智能)Syneo平台介绍