当前位置:网站首页>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 .
边栏推荐
- Node red series (28): communication with Siemens PLC based on OPC UA node
- [note] May 23, 2022 MySQL
- 【作业】2022.5.25 MySQL 查操作2
- 【论文阅读|深读】DANE:Deep Attributed Network Embedding
- Linear interpolation of spectral response function
- SQLyog导入数据库时报错,求帮解决!
- SQL server2005中SUM函数中条件筛选(IF)语法报错
- 在大厂外包呆了三年,颠覆了我的认知!
- SQL追加字段
- 你清楚AI、数据库与计算机体系
猜你喜欢

Error encountered in SQL statement, solve

Sql语句遇到的错误,求解

【力扣刷题总结】数据库题目按知识点分类总结(持续更新/简单和中等题已完结)

An error occurs when sqlyog imports the database. Please help solve it!

在大厂外包呆了三年,颠覆了我的认知!

Play with algorithm interview together, nanny level strategy (with high-definition codeless algorithm summary map), recommended collection

EasyCVR部署服务器集群时,出现一台在线一台不在线是什么原因?

dotnet-exec 0.5.0 released

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

【云原生】AI云开发平台——AI Model Foundry介绍(开发者可免费体验AI训练模型)
随机推荐
[operation] write CSV to database on May 28, 2022
win10系统使用浏览器下载后,内容无故移动或删除
Node red series (28): communication with Siemens PLC based on OPC UA node
Unity when entering a string in the editor, escape the input of characters
使用IDEAL连接数据库,运行出来了 结果显示一些警告,这部分怎么处理
How to analyze and solve the problem of easycvr kernel port error through process startup?
【图像融合】基于交叉双边滤波器和加权平均实现多焦点和多光谱图像融合附matlab代码
Collinearity problem
【力扣刷题总结】数据库题目按知识点分类总结(持续更新/简单和中等题已完结)
I spent three years in a big factory outsourcing, which subverted my understanding!
[Note] ab Test and Variance Analysis
巧用 Bitmap 实现亿级海量数据统计
【论文阅读|深读】Role2Vec:Role-Based Graph Embeddings
I get n offers in two months. I don't have any difficult interviewers here
【作业】2022.5.25 MySQL 查操作2
你清楚AI、数据库与计算机体系
[operation] MySQL query operation 2 on May 25, 2022
Knowledge - how to build rapport in sales with 3 simple skills
【论文阅读|深读】DANE:Deep Attributed Network Embedding
Unity 在編輯器中輸入字符串時,轉義字符的輸入