cartographer坐标系_Cartographer使用流程-建图-纯定位-导航

更新时间:2023-06-07 12:05:56 阅读: 评论:0

cartographer坐标系_Cartographer使⽤流程-建图-纯定位-导航问题:
1、官⽅下载地址;
2、官⽅⽂档;
安装
跑数据集
下载数据集
跑数据集建图
roslaunch cartographer_ros offline_backpack_2d.launch bag_filenames:=${HOME}/Downloads/b2-2016-04-05-14-44-
52.bag
跑数据集纯定位测试
roslaunch cartographer_ros demo_backpack_2d_localization.launch \
load_state_filename:=${HOME}/Downloads/b2-2016-04-05-14-44-52.bag.pbstream \
bag_filename:=${HOME}/Downloads/b2-2016-04-27-12-31-41.bag
这⾥后⾯两个参数⼀个是上⼀步建好的地图,pbstream格式,另⼀个是数据集。也就是说,先⽤第⼀个数据集建图,建完图后⽤第⼆个数据集进⾏定位测试。
主要修改⽂件及参数
依据原有参考⽂件新建⽂件
⽂件对应关系
backpack_2d.launch -> my_robot_2d.launch
demo_backpack_2d.launch -> demo_my_robot_2d.launch
合格率是什么意思offline_backpack_2d.launch -> offline_my_robot_2d.launch
demo_backpack_2d_localization.launch -> demo_my_robot_localization_2d.launch
asts_writer_backpack_2d.launch -> asts_writer_my_robot_2d.launch
跟我走英文backpack_2d.lua -> my_robot_2d.lua
backpack_2d_localization.lua -> my_robot_2d_localization.lua
aats_writer_backpack_2d.lua -> aats_writer_my_robot_2d.lua
建图
建图操作流程
主要包含:激光雷达、移动机器⼈(轮椅)、cartographer。
1、启动激光雷达
roslaunch urg_node urg_lidar.launch
jane doe
2、启动轮椅
rosrun wheel_chair wheel_driver
roslaunch cartographer_ros demo_revo_lds.launch
备注:不需要⾥程信息,也可以建图;在建图过程中,轮椅编码器未转动。
可将如上流程写成launch⽂件:
主要注意:TF、Topic
TF-tree关系
map
|----odom
|----ba_footprint(差动轮中⼼)
|---- ba_link(轮椅)
|----ba_scan(激光雷达)
坐标间关系建⽴
1、轮椅建⽴odom、ba_footprint、ba_link、ba_scan三者之间的关系。
其中,up是什么意思英文
ba_footprint、ba_link、ba_scan,三者之间为固定关系,可在launch⽂件中建⽴为静态坐标系,固定周期发布;
doubba_footprint相对于odom为⾥程关系,根据运动实时计算⾥程计推算的位姿,需要实时发布;
2、Cartographer查阅TF-tree上的ba_scan相对于map的关系,根据激光点云定位ba_scan,并根据ba_link与ba_scan的关系追踪ba_link的位姿,最终推算odom相对于map的位姿关系并发布。简⽽⾔之,cartographer通过修整odom相对于map的关系,从⽽定位机器⼈ba_link相对于map的关系。
在.lua配置⽂件中设定如下值:
map_frame = "map",
tracking_frame = "ba_link",
published_frame = "odom",
odom_frame = "odom",
provide_odom_frame = fal,
u_odometry = true,
北京高端美甲学校
保存地图
不再接受进⼀步数据
rosrvice call /finish_trajectory 0
序列化保存其当前状态
rosrvice call /write_state "{filename: '${HOME}/Downloads/mymap_name.pbstream'}"
将pbstream转换为pgm和yaml
rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=${HOME}/Downloads/mymap_name -pbstream_filename=${HOME}/Downloads/mymap_name.pbstream -resolution=0.05
纯定位
导航
启动⽂件:
附件
主要更改的⽂件
my_robot_2d_localization.lua
⽂件功能:配置机器⼈纯定位的相关参数。保证定位过程中的低延时特性。
include "my_robot_2d.lua"
-- TRAJECTORY_BUILDER.pure_localization_trimmer = {
-- max_submaps_to_keep = 3, -- 最⼤保存⼦图数,存定位模式通过⼦图进⾏定位,但只需要当前和上⼀个⼦图即可,我这⾥设置的是2 -- }
TRAJECTORY_BUILDER.pure_localization = true
POSE_GRAPH.optimize_every_n_nodes = 20
-- output map to ba_link for evaluation
-- options.provide_odom_frame = fal
-- POSE_GRAPH.optimization_problem.log_solver_summary = true
-- fast localizationpatiently
MAP_BUILDER.num_background_threads = 8
straint_builder.sampling_ratio = 0.5 * straint_builder.sampling_ratio
POSE_GRAPH.global_sampling_ratio = 0.1 * POSE_GRAPH.global_sampling_ratio
POSE_GRAPH.max_num_final_iterations = 1
爱探险的朵拉第二季
return options
my_robot_2d.lua
⽂件功能:配置机器⼈相关参数,主要坐标系名称、是否有⾥程计/卫星/地标,传感器数量,传感器测量范围等。
include "map_builder.lua"bbc可可英语
include "trajectory_builder.lua"
options = {
map_builder = MAP_BUILDER,
trajectory_builder = TRAJECTORY_BUILDER,
map_frame = "map",
tracking_frame = "ba_link",
published_frame = "ba_link",
odom_frame = "odom",
provide_odom_frame = true,
publish_frame_projected_to_2d = true,
u_odometry = true,
u_nav_sat = fal,
u_landmarks = fal,
num_lar_scans = 1,
num_multi_echo_lar_scans = 0,
num_subdivisions_per_lar_scan = 10,
num_point_clouds = 0,
lookup_transform_timeout_c = 0.2,
submap_publish_period_c = 0.3,
po_publish_period_c = 10e-3,
trajectory_publish_period_c = 30e-3,
rangefinder_sampling_ratio = 1.,
odometry_sampling_ratio = 1.,
fixed_frame_po_sampling_ratio = 1.,
imu_sampling_ratio = 1e-3,
landmarks_sampling_ratio = 1.,
}
MAP_BUILDER.u_trajectory_builder_2d = true
TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 10 TRAJECTORY_BUILDER_2D.u_imu_data = fal
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_po_translation_weight = 1e5 POSE_GRAPH.optimization_problem.local_slam_po_rotation_weight = 1e5 POSE_GRAPH.optimization_problem.odometry_translation_weight = 1e4
POSE_GRAPH.optimization_problem.odometry_rotation_weight = 1e4
return options
offline_my_robot_2d_localization.lua
主要功能:离线定位测试,仅⽤单激光雷达,⽆⾥程计。
include "offline_my_robot_2d.lua"
-- TRAJECTORY_BUILDER.pure_localization_trimmer = {
pandaren-- max_submaps_to_keep = 3, -- 最⼤保存⼦图数,存定位模式通过⼦图进⾏定位,但只需要当前和上⼀个⼦图即可,我这⾥设置的是2 -- }
TRAJECTORY_BUILDER.pure_localization = true
POSE_GRAPH.optimize_every_n_nodes = 20
-- output map to ba_link for evaluation
-- options.provide_odom_frame = fal
-- POSE_GRAPH.optimization_problem.log_solver_summary = true
-- fast localization
MAP_BUILDER.num_background_threads = 8
straint_builder.sampling_ratio = 0.5 * straint_builder.sampling_ratio
POSE_GRAPH.global_sampling_ratio = 0.1 * POSE_GRAPH.global_sampling_ratio
POSE_GRAPH.max_num_final_iterations = 1
return options
offline_my_robot_2d.lua
⽂件功能:离线机器⼈参数,仅有单线激光雷达。
include "map_builder.lua"
include "trajectory_builder.lua"
options = {
map_builder = MAP_BUILDER,
trajectory_builder = TRAJECTORY_BUILDER,
map_frame = "map",
tracking_frame = "lar_frame",
published_frame = "lar_frame",
odom_frame = "odom",
provide_odom_frame = fal,
publish_frame_projected_to_2d = fal,
u_odometry = fal,
u_nav_sat = fal,
u_landmarks = fal,
num_lar_scans = 1,
num_multi_echo_lar_scans = 0,
num_subdivisions_per_lar_scan = 10,
num_point_clouds = 0,

本文发布于:2023-06-07 12:05:56,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/136983.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:定位   参数   关系   数据   机器   过程   建图
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图