思岚激光雷达+cartographer建图

news/2024/12/21 20:45:45/

系统环境:

Ubuntu18.04

ROS Melodic

gcc 7.5.0

1.安装思岚ROS包

1.1 clone并编译

cd catkin_ws/src/
git clone https://github.com/Slamtec/rplidar_ros.git
cd ..
catkin_make

1.2 修改rplidar_ros/launch/rplidar.launch中的波特率

1.3 试一下效果

source devel/setup.bash
roslaunch rplidar_ros view_rplidar.launch

效果如图

2.部署cartographer

参考官方文档

sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow# 此处为cartographer新建了一个ws
mkdir carto_ws
cd carto_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src# 安装依赖
# 如果安装ROS的时候执行过'sudo rosdep init',那么这里会报错,报错可以忽略
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y# 安装abseil-cpp library
src/cartographer/scripts/install_abseil.sh# 编译并安装
catkin_make_isolated --install --use-ninja

试一下官方给的demo

wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
source install_isolated/setup.bash
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag

这里是2D的bag,3D的文件太大,故没有下载

如果成功了则可进行下一步

3.使用自己的激光雷达数据

3.1 修改revo_lds.lua

gedit carto_ws/src/cartographer_ros/cartographer_ros/configuration_files/revo_lds.lua

我的lua如下:

include "map_builder.lua"
include "trajectory_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "laser",
  published_frame = "laser",
  odom_frame = "base_link",
  provide_odom_frame = true,
  publish_frame_projected_to_2d = false,
  use_pose_extrapolator = true,
  use_odometry = false,
  use_nav_sat = false,
  use_landmarks = false,
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  lookup_transform_timeout_sec = 0.2,
  submap_publish_period_sec = 0.3,
  pose_publish_period_sec = 5e-3,
  trajectory_publish_period_sec = 30e-3,
  rangefinder_sampling_ratio = 1.,
  odometry_sampling_ratio = 1.,
  fixed_frame_pose_sampling_ratio = 1.,
  imu_sampling_ratio = 1.,
  landmarks_sampling_ratio = 1.,
}

MAP_BUILDER.use_trajectory_builder_2d = true

TRAJECTORY_BUILDER_2D.submaps.num_range_data = 35
TRAJECTORY_BUILDER_2D.min_range = 0.3
TRAJECTORY_BUILDER_2D.max_range = 8.
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 1.
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.linear_search_window = 0.1
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.translation_delta_cost_weight = 10.
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.rotation_delta_cost_weight = 1e-1

POSE_GRAPH.optimization_problem.huber_scale = 1e2
POSE_GRAPH.optimize_every_n_nodes = 35
POSE_GRAPH.constraint_builder.min_score = 0.65

return options

3.2 修改demo_revo_lds.launch

gedit carto_ws/src/cartographer_ros/cartographer_ros/launch/demo_revo_lds.launch

我的launch如下:

<launch>
  <param name="/use_sim_time" value="false" />

  <node name="cartographer_node" pkg="cartographer_ros"
      type="cartographer_node" args="
          -configuration_directory $(find cartographer_ros)/configuration_files
          -configuration_basename revo_lds.lua"
      output="screen">
    <remap from="scan" to="scan" />
  </node>

  <node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
      type="cartographer_occupancy_grid_node" args="-resolution 0.05" />

  <node name="rviz" pkg="rviz" type="rviz" required="true"
      args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" />
</launch>

3.3 再次编译

cd carto_ws
catkin_make_isolated --install --use-ninja

 4.试一下效果

roslaunch rplidar_ros rplidar.launch
roslaunch cartographer_ros demo_revo_lds.launch

如果找不到包,记得source setup.bash

效果如下

5.参考文章

Cartographer ROS Integration — Cartographer ROS documentation

使用思岚A2激光雷达结合cartographer建图算法手持建图_这个昵称已已已存在的博客-CSDN博客_cartographer手持建图


http://www.ppmy.cn/news/667491.html

相关文章

并行强化学习算法:A2C/A3C

目录 背景介绍 A3C模型 A3C损失函数 A3C学习过程 A2C 总结 背景介绍 在DQN中&#xff0c;为了保证数据的有效性&#xff0c;采用了 Experience Replay Memory机制&#xff1a; 但是这种机制&#xff0c;存在几个问题&#xff1a;1&#xff0c;会占据大块的内存&#xff…

ROS小车记录系列(一)RPLIDAR A3驱动、角度屏蔽、数据过滤

&#xff08;一&#xff09;RPLIDAR A3驱动、角度屏蔽、数据过滤 A3驱动角度屏蔽、数据过滤 【这个型号效果不好&#xff0c;最终我没采用–2021.5.30】 A3驱动 从头搭建ROS巡航车&#xff0c;先解决激光雷达&#xff0c;使用的思岚RPLIDAR A3&#xff0c;配置步骤这里&#x…

【强化学习】Asynchronous Advantage Actor-Critic(A3C)

1 A3C简介 A3C全称Asynchronous Advantage Actor-Critic&#xff0c;顾名思义&#xff0c;它采用的是Actor-Critic的形式&#xff08;需要回顾Actor-Critic的&#xff0c;可以点击这里【强化学习】Actor-Critic&#xff08;演员-评论家&#xff09;算法详解&#xff09;。为了…

超快激光啁啾放大技术的原理及应用

超快激光啁啾放大技术的原理及应用 自激光发明以来&#xff0c;各种各样的激光器层出不穷&#xff0c;激光系统向着短脉冲、高功率、高质量的方向不断发展。在调Q技术和锁模技术的放大遭遇技术瓶颈时&#xff0c;啁啾放大技术应运而生。本文首先介绍了啁啾脉冲放大技术的相关背…

apollo7.0 初探------激光雷达感知测试

之前一直有看过apollo的程序&#xff0c;一般都是参考某个模块直接去看代码&#xff0c;并没有完整的安装跑一下官方的程序&#xff0c;趁假期简单安装熟悉了一下基于cyber的apollo7.0, 准备后面完整的调试一下感知各个模块。 我用的笔记本环境&#xff1a;Ubuntu18.04 cuda10…

RPLIDAR A3激光雷达16K采样和25M测距

2018年2月1日SLAMTEC-思岚科技正式对外发布其激光雷达RPLIDAR系列的最新产品RPLIDAR A3。此次发布的RPLIDAR A3依然延续思岚三角测距代表技术&#xff0c;在整体性能上做了一次革命性的大提升。这一消息无疑给做消费级激光雷达行业提出了更高的标准。 基于思岚最新的RPVision …

matlab 半导体激光模拟工具箱,MATLAB中的激光器仿真

MATLAB中的激光器仿真 matlab 2020-10-25 下载地址 https://www.codedown123.com/45607.html MATLAB中的激光器仿真 包含锁模激光器的部件仿真 不同维度的脉冲仿真 资源下载此资源下载价格为2D币,请先登录 资源文件列表 程序/光孤子传输仿真程序/光孤子传输仿真程序/readme.tx…

RPLIDAR A3开箱实测

通过内部申请&#xff0c;有幸拿到一台思岚最新发布的 RPLIDAR A3激光雷达&#xff0c;就迫不及待想写个测评&#xff0c;跟大家分享一波&#xff0c;先睹为快。 包装盒里除了雷达本体之外&#xff0c;还配有一块TTL串口转USB接口的转接板&#xff0c;以及一根很短的USB线。 下…