当前位置:网站首页>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

ESP32 LVGL8. 1 - textarea text area (textarea 26)

Halo open source project learning (VII): caching mechanism

机器学习理论之(7):核函数 Kernels —— 一种帮助 SVM 实现非线性化决策边界的方式

Notepad + + replaces tabs with spaces

使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA

os_authent_prefix

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

Custom prompt box MessageBox in QT
随机推荐
Seata handles distributed transactions
How can programmers quickly develop high-quality code?
机器学习理论之(8):模型集成 Ensemble Learning
使用晨曦记账本,分析某个时间段每个账户收支结余
ESP32 LVGL8. 1 - textarea text area (textarea 26)
ESP32 LVGL8. 1 - BTN button (BTN 15)
Jeecg boot microservice architecture
Const keyword, variable and function are decorated with const
Quantexa CDI(场景决策智能)Syneo平台介绍
STM32: LCD display
CANopen usage method and main parameters of object dictionary
Hard core parsing promise object (do you know these seven common APIs and seven key questions?)
SQL中函数 decode()与 replace()的用法
In win10 system, all programs run as administrator by default
C language simulates entering and leaving the stack, first in first out, first in first out, shared memory
Machine learning practice - naive Bayes
STM32: LCD显示
Advanced transfer learning
迁移学习进阶
[mathematical modeling] - analytic hierarchy process (AHP)