当前位置:网站首页>2D laser Slam (using laser scan matcher)
2D laser Slam (using laser scan matcher)
2022-06-23 11:59:00 【Mr anhydrous】
One 、Laser Scan Matcher Installation configuration
ROS Self contained laser_scan_matcher library , It uses CSM(Canonical Scan Matcher), It's pure. C The realization of language PLICP Algorithm . Besides ,laser_scan_matcher It's integrated gmapping, So that we don't need a odometer , You can use it gmapping To build a map .
If you use Kinetic Version of ROS, Can directly apt download
First , You need to determine if... Is installed laser_scan_matcher
apt search laser-scan-matcherIf installed , Can be used directly ; If not in accordance with , Then use apt install install
sudo apt install ros-noetic-laser-scan-matcherTo configure launch Document and rviz file , Pay attention to your own ros edition
sudo cp ~/XTDrone/sensing/slam/laser_slam/laser_scan_matcher/launch/* /opt/ros/kinetic/share/laser_scan_matcher/demo/
sudo cp ~/XTDrone/sensing/slam/laser_slam/laser_scan_matcher/rviz/* /opt/ros/kinetic/share/laser_scan_matcher/demo/If you use Melodic Version of ROS, Need to compile from source code , Please refer to
Can't build laser_scan_matcher for melodic · Issue #63 · CCNYRoboticsLab/scan_tools · GitHub
And then put ~/XTDrone/sensing/slam/laser_slam/laser_scan_matcher/ Medium launch Document and rviz The file should be copied to catkin_ws/src/scan_tools/laser_scan_matcher/demo/ in .
in addition , It also needs to be installed map_server Function pack
sudo apt install ros-kinetic-map-server #melodic Corresponding modification is enough Two 、 Two dimensional laser positioning
indoor3.world Composed of walls , Suitable for two-dimensional laser SLAM. First you need to modify launch file , One is to add the transformation relationship between the lidar coordinate system and the body coordinate system , Instead, choose models with lidar . Here is a scheme ( Pay attention to the 3、4、18 That's ok )
gedit ~/PX4_Firmware/launch/indoor3.launch<?xml version="1.0"?>
<launch>
<node pkg="tf" type="static_transform_publisher" name="iris_0_base_link_to_laser"
args="0.0 0.0 0.06 0.0 0.0 0.0 /base_link /iris_0/laser_2d 40" />
<!-- MAVROS posix SITL environment launch script -->
<!-- launches MAVROS, PX4 SITL, Gazebo environment, and spawns vehicle -->
<!-- vehicle pose -->
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" default="0"/>
<arg name="R" default="0"/>
<arg name="P" default="0"/>
<arg name="Y" default="0"/>
<!-- vehicle model and world -->
<arg name="est" default="ekf2"/>
<arg name="vehicle" default="iris"/>
<arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/indoor3.world"/>
<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/iris_2d_lidar/iris_2d_lidar.sdf"/>start-up PX4 Simulation ,
cd ~/PX4_Firmware
roslaunch px4 indoor3.launch Start at another terminal PLICP
roslaunch laser_scan_matcher matcher.launch The laser and gitee The animation on the home page is different , Because the angle and distance of laser scanning have changed , These can be modified according to your requirements , See 2d Lidar model .

Then the laser SLAM Two dimensional positioning topic will be published
rostopic echo /iris_0/pose2Dx: 0.0
y: 2.22044604925e-16
theta: 0.0
---
x: 0.0
y: 6.66133814775e-16
theta: 1.11022302463e-16
---
x: -1.66533453694e-16
y: -2.22044604925e-16
theta: 1.66533453694e-16
---Then establish communication
cd ~/XTDrone/communication
python multirotor_communication.py iris 0
Due to the two-dimensional laser SLAM Only the horizontal position information of UAV can be obtained , therefore , UAV positioning also needs altitude information , The height information used here is Gazebo The height of the hair is true . Because this coordinate system is different from the coordinate system of UAV , Therefore, the corresponding coordinate transformation is required and transformed into the corresponding mavros topic of conversation .
cd ~/XTDrone/sensing/slam/laser_slam/script/
python laser_transfer_old.py iris 0 2d
So the location information passes through mavros Sent to PX4, Can be in PX4 The simulation terminal sees
INFO [ecl/EKF] 19804000: reset position to ev position
INFO [ecl/EKF] 19804000: commencing external vision position fusion
INFO [ecl/EKF] 19804000: commencing external vision yaw fusionControl the UAV to take off
cd ~/XTDrone/control/keyboard
python multirotor_keyboard_control.py iris 1 vel
Here we are , You have realized the use of PLICP Achieve positioning , The next step is to build a two-dimensional grid map (Occupancy Grid Map), Prepare for two-dimensional motion planning .
Two dimensional laser mapping
Put it on first gmapping.
sudo apt-get install ros-kinetic-slam-gmapping The above process is similar , But at the same time PLICP+gmapping, And use the keyboard to control the movement of the aircraft , Walk through the whole map , Realize the establishment of a complete map . Be careful not to fly too fast , Otherwise, the consistency of the map will be bad .
roslaunch laser_scan_matcher matcher_gmapping.launchrviz By default, all frame, It looks messy , We just need to observe base_link and map Just fine , You can go to rviz Put something else in the frame close .rviz The coordinate system in ,x The axis corresponds to red (red),y The axis corresponds to green (green),z The axis corresponds to blue (blue),xyz It's exactly the same as rgb, It's easier to remember .

When the maps are built , adopt map_server You can save the map , obtain indoor3.pgm and indoor3.yaml, For the next example Two dimensional motion planning Provide maps .
rosrun map_server map_saver -f ~/XTDrone/motion_planning/2d/map/indoor3
In this example , It involves some coordinate system transformation and topic naming problems ,XTDrone These problems have been solved in advance , But if developers want to add lidar to other models , Carry out laser SLAM, Then it is necessary to study . The following shows the... Of this example TF Tree and Node Graph, For developers to reference .


Here we are , Two dimensional laser SLAM The simulation is complete ! Congratulations on completing another simulation !
边栏推荐
- 十大劵商如何开户?在线开户安全么?
- Introduction to redis - Chapter 3 - data structures and objects - Dictionary
- Video data annotation tools and platforms (data annotation company)
- Redis 入门-第四篇-数据结构与对象-跳跃表
- HMS Core 视频编辑服务开放模板能力,助力用户一键Get同款酷炫视频
- Meta said that the UK security law may "scan all private information" or infringe privacy
- Redis 入门-第三篇-数据结构与对象-字典
- 一张图解码 OpenCloudOS 社区开放日
- php 手写一个完美的守护进程
- 全国进入主汛期,交通运输部:不具备安全运行条件的线路坚决停运!
猜你喜欢

16路HD-SDI光端机多路HD-SDI高清视频光端机16路3G-SDI高清音视频光端机

基本数据类型和对应的包装类

广播级E1转AES-EBU音频编解码器 E1转立体声音频卡侬头(XLR)编解码器

Proof and application of Chebyshev inequality

Invalid Navicat scheduled task

ROS2知识(6):坐标对象TF原理和实践

【云原生&微服务八】Ribbon负载均衡策略之WeightedResponseTimeRule源码剖析(响应时间加权)

利用XtraDiagram.DiagramControl进行流程图形的绘制和控制

Learning notes sweep crawler framework

The computer broke down. I changed the computer. There was a problem installing the node environment. The URL is not defined
随机推荐
并购增资或将有望启动东软越通新动能?
HMS core video editing service has the ability to open templates, helping users get the same cool video with one click
视频数据标注工具与平台(数据标注公司)
QT知识:Qt Widgets小部件函数【02】
Easy to understand soft route brushing tutorial
[comprehensive written test questions] 30 Concatenate substrings of all words
汉源高科1路非压缩4K-DVI光端机4K高清非压缩DVI转光纤4K-DVI高清视频光端机
ROS知识:读取点云数据文件
Three ways to learn at work
Common fault analysis and Countermeasures of MySQL in go language
QT5知识:信号和槽的一些要点
ROS知识:librviz库的调用实践
32路电话+2路千兆以太网32路PCM电话光端机支持FXO口FXS语音电话转光纤
Blue Bridge Cup single chip microcomputer (I) -- turn off peripherals and turn off led
十大劵商如何开户?在线开户安全么?
CIFAR公开第二阶段泛加拿大AI战略
QT知识:Qt Widgets小部件类【01】
KDD 2022 | 基于分层图扩散学习的癫痫波预测
Meta said that the UK security law may "scan all private information" or infringe privacy
halcon知识:dyn_threshold的用法(划痕检测)