当前位置:网站首页>Slam mapping, automatic navigation and obstacle avoidance based on ROS (bingda robot)
Slam mapping, automatic navigation and obstacle avoidance based on ROS (bingda robot)
2022-06-30 04:04:00 【Veteran fisherman in 2001】
SLAM yes Simultaneous localization and mapping abbreviation , Meaning for “ Synchronous positioning and mapping ”, It is mainly used to solve the problem of localization and map construction when the robot moves in unknown environment . The robot moves from an unknown position in an unknown environment , Position yourself according to the location and map during the movement , At the same time, build incremental maps on the basis of their own positioning , Realize autonomous positioning and navigation of robot .
The trolley can run ros Lidar function pack , stay PC Terminal rviz Can be viewed in ; Starting the chassis 、 After keyboard control, the trolley can be controlled to move ; according to SLAM The algorithm maps the laboratory environment ; It can be saved 、 Read the map , stay PC End control trolley from A Point to B Point to achieve path planning and automatic obstacle avoidance .
This paper takes bingda robot car as an example , Some problems have been encountered in actual use , A more detailed tutorial summarized .
software platform :Linux(Ubuntu18.04.6).
Hardware platform : Bingda robot .
Language version :Python 2.7
One . install ROS And configuration environment
1.ROS install
I recommend using the one click installation of Xiaoyu , Can solve 99% The problem of
One click installation instruction :
wget http://fishros.com/install -O fishros && . fishros Official website : Home page | Fish fragrance ROS( But teaching is ROS2 Mainly , Bingda robot can only use ROS1)
Open source address :https://github.com/fishros/install
2. Work area installation
First of all, from the git Download the required feature pack to your workspace , We still use catkin_ws Take a workspace as an example
mkdir -p ~/catkin_ws/src/
cd ~/catkin_ws/src/
git clone https://gitee.com/bingda-robot/base_control.git
git clone https://gitee.com/bingda-robot/lidar.git
git clone https://gitee.com/bingda-robot/robot_vision.git
git clone https://gitee.com/bingda-robot/robot_navigation.git
git clone https://gitee.com/bingda-robot/robot_simulation.gitCompile the workspace after pulling
cd ~/catkin_ws/
catkin_make
Then we will solve the function package dependency
If your rosdep It can be used normally. ( It can be used normally according to this tutorial ), So you can go through rosdep To check whether all the dependent packages meet
cd ~/catkin_ws/
rosdep check --from-path src
If the result of execution is “All system dependencies have been satisfied”, Then all dependent items have met , No installation required
otherwise , Then execute the following instructions to install the dependent packages
rosdep install --from-path src -y
If your rosdep Not working properly , Then you can install it manually by installing the dependency list provided by us
sudo apt-get update
sudo apt-get install ros-$ROS_DISTRO-teleop-twist-keyboard ros-$ROS_DISTRO-amcl ros-$ROS_DISTRO-move-base ros-$ROS_DISTRO-slam-gmapping ros-$ROS_DISTRO-slam-karto ros-$ROS_DISTRO-cartographer ros-$ROS_DISTRO-cartographer-ros ros-$ROS_DISTRO-dwa-local-planner ros-$ROS_DISTRO-teb-local-planner ros-$ROS_DISTRO-uvc-camera ros-$ROS_DISTRO-map-server ros-$ROS_DISTRO-hector-slam* ros-$ROS_DISTRO-global-planner ros-$ROS_DISTRO-navfn -ySet the environment variable
cd /catkin_ws/devel
source setup.bashTwo . Configure distributed
- Connecting robots :ssh [email protected]
- Open the virtual machine terminal input ,ifconfig see Ubuntu Of IP Address , Let the two machines interact ping, Make sure you can receive data .
- stay PC End Input gedit .bashrc Yes .bashrc Make changes ( name 、 robot ip), Add relevant information , As shown in the figure below .

chart 1 .bashrc New contents of the document
3、 ... and . Synchronize trolley time
. because robot No power-off protection , So after every shutdown and restart , Its time cannot correspond to the real time , And ours pc Is able to connect to the Internet , Can pass ntp Server time calibration
If in the experiment pc No extranet environment , Help first pc Get an Internet environment , Then install a ntp The server :
[email protected]:sudo apt install ntpTake us pc Think of it as a ntp The server ,robot According to pc Do your own time calibration :
[email protected]:sudo ntpdate 192.168.x.x // Everyone's computer assigned ip Different , Here with their own pc Of ip Subject to If you find that robot Unable to get pc Time calibration , Then calibrate the time manually :
[email protected]:sudo date --s=" 2022-06-21 11:12:00"Four . Start the lidar
- Start the lidar :
[email protected]:roslaunch robot_navigation lidar.launch- View published topics , Looking for radar :
[email protected]:rostopic list 3. Print radar scanned data :
[email protected]:rostopic echo /scan4.pc: use rviz Look at the image :
[email protected]:roslaunch robot_navigation lidar_rviz.launch
chart 2 Run lidar
5、 ... and . Run lidar and laser SLAM Drawing
1. Run lidar :
[email protected]:roslaunch robot_navigation robot_slam_laser.launch2. Start the chassis :
[email protected]:roslaunch base_control base_control.launch3. Activate keyboard control :
rosrun teleop_twist_keyboard teleop_twist_keyboard.py4. use rviz Look at the image :
[email protected]:roslaunch robot_navigation slam_rviz.launch5. View map file :
[email protected]:roscd robot_navigation/maps6. preservation map:
[email protected]:rosrun map_server map_saver -f map
chart 3 Saved map and nodes
6、 ... and . Run lidar and obstacle avoidance
1. Run lidar to avoid obstacles ( Will read the previously saved map ):
[email protected]:roslaunch robot_navigation robot_navigation.launch2. use rviz see :
[email protected]:roslaunch robot_navigation navigation_rviz.launch3. use 2D Pose Estimate Change the initial test position , Make the radar range of the car basically consistent with the previously saved map .
4. use 2D Nav Goal Point to our destination , The trolley will automatically plan the path and drive to the target point .

chart 4 Read the map

chart 5 Path planning
7、 ... and . Other questions
1. No map data
Check the distributed configuration ( mutual ping);
Check Python edition , It must be Python2.
2.xxx is neither a launch file in package nor xxx is a launch file name
The workspace environment was not added to .bashrc, Or go to the workspace directory before each run source once .
This article only represents personal views , If there is a mistake , I hope readers can point out .
边栏推荐
- Hebb and delta learning rules
- Errno and PERROR
- The school training needs to make a registration page. It needs to open the database and save the contents entered on the registration page into the database
- 【笔记】2022.5.23 MySQL
- From 2500 a month, no one wants to go to the programming road of the technical director of a large factory | my ten years
- dotnet-exec 0.5.0 released
- Grasp grpc communication framework in simple terms
- 你清楚AI、数据库与计算机体系
- Interpretation score of bilstm-crf in NER_ sentence
- el-upload上传文件(手动上传,自动上传,上传进度)
猜你喜欢
![[cloud native] AI cloud development platform - Introduction to AI model foundry (developers can experience AI training model for free)](/img/08/b390810d457af5e4470d9743b01ca1.png)
[cloud native] AI cloud development platform - Introduction to AI model foundry (developers can experience AI training model for free)

lego_ Reading and summary of loam code

Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column

Interface test tool postman

AI落地的新范式,就“藏”在下一场软件基础设施的重大升级里
![[note] on May 27, 2022, MySQL is operated through pychart](/img/34/36a3765683b2af485ca7c3e366da59.png)
[note] on May 27, 2022, MySQL is operated through pychart

Linear interpolation of spectral response function

How to analyze and solve the problem of easycvr kernel port error through process startup?

How to view Tencent's 2022 school recruitment salary, the total contract of cabbage is 40W?

DO280私有仓库持久存储与章节实验
随机推荐
[summary of skimming questions] database questions are summarized by knowledge points (continuous update / simple and medium questions have been completed)
Graduation project EMS office management system (b/s structure) +j2ee+sqlserver8.0
How to use Jersey to get the complete rest request body- How to get full REST request body using Jersey?
技术分享| 融合调度中的广播功能设计
【筆記】AB測試和方差分析
[note] May 23, 2022 MySQL
Do280 private warehouse persistent storage and chapter experiment
errno和perror
使用IDEAL连接数据库,运行出来了 结果显示一些警告,这部分怎么处理
win10系统使用浏览器下载后,内容无故移动或删除
How to analyze and solve the problem of easycvr kernel port error through process startup?
Interface testing -- how to analyze an interface?
How to use FME to create your own functional software
idea灰屏问题
华为云原生——数据开发与DataFactory
UML diagrams and list collections
学校实训要做一个注册页面,要打开数据库把注册页面输入的内容存进数据库但是
DBT product initial experience
解决navicat连接数据库遇到的问题
第十一天 脚本与游戏AI