ROS小车搭建——Cartographer建图

说明:
不用里程计也可以建图

内部原理

ROS小车搭建——Cartographer建图_第1张图片

使用里程计时的配置

lua文件配置疑惑解答

不使用外部里程计
odom_frame= "odom"
provide_odom_frame=true
use_odometry = false

使用外部里程计

odom_frame= "odom"
provide_odom_frame= false
use_odometry = true

厦门大学参考

厦门大学博客参考:Cartographer使用流程-建图-纯定位-导航

map_frame = "map",
tracking_frame = "base_link",
published_frame = "odom",
odom_frame = "odom",

provide_odom_frame = false,
use_odometry = true,

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

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,

  map_frame = "map",
  tracking_frame = "base_link",
  published_frame = "base_link",
  odom_frame = "odom",

  provide_odom_frame = true,
  publish_frame_projected_to_2d = true,

  use_odometry = true,
  use_nav_sat = false,
  use_landmarks = false,

  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 10,
  num_point_clouds = 0,

  lookup_transform_timeout_sec = 0.2,
  submap_publish_period_sec = 0.3,
  pose_publish_period_sec = 10e-3,
  trajectory_publish_period_sec = 30e-3,
  rangefinder_sampling_ratio = 1.,
  odometry_sampling_ratio = 1.,
  fixed_frame_pose_sampling_ratio = 1.,
  imu_sampling_ratio = 1e-3,
  landmarks_sampling_ratio = 1.,
}

MAP_BUILDER.use_trajectory_builder_2d = true

TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 10
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.min_range = 0.1,
TRAJECTORY_BUILDER_2D.max_range = 8.0,
TRAJECTORY_BUILDER_2D.min_z = -0.05,
TRAJECTORY_BUILDER_2D.max_z = 0.5,
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 8.0

POSE_GRAPH.optimization_problem.local_slam_pose_translation_weight = 1e5
POSE_GRAPH.optimization_problem.local_slam_pose_rotation_weight = 1e5
POSE_GRAPH.optimization_problem.odometry_translation_weight = 1e4
POSE_GRAPH.optimization_problem.odometry_rotation_weight = 1e4

return options

ROS小车搭建——Cartographer建图_第2张图片
实验室室内图

不使用里程计时的配置

效果图

ROS小车搭建——Cartographer建图_第3张图片
蓝色为轨迹线

你可能感兴趣的:(ROS小车搭建——Cartographer建图)