cartographer(2)-launch-lua的配置

1.了解bag

|---|-------------------------------------|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| | | | |
| 1 | roscore | | |
| 2 | rosbag info rslidar-outdoor-gps.bag | 了解bag中topic的名称与类型 | duration: 3:33s types: geometry_msgs?QuaternionStamped nav_msgs_Odometry sensor_msgs/Imu sensor_msgs/IaserScan sensor_msgs/NavSatFix sensor_msgs/PointCloud2 tf2 msgs/TFMessage topics:/fix:gps的 /front_scan: 单线雷达数据 /heading: 两个GPS执行出来的航向 /imu: IMU的topic /odom_scout:里程计 /rslidar_points: 速腾的16点云数据 /tf: /tf_static: 静态的tf数据 |
| 3 | rosbag play rslidar-outdoor-gps.bag | 运行bag中topic的名称与类型 | 空格用于启动和停止 |
| 4 | rqt | 了解bag中的tf树. 1.plugins ->visualization->tf tree 2.plugins ->Introspection->node graph 看节点树 发布了很多topic数据 | |
| 5 | rviz | 可视化雷达数据与tf数据 rviz左侧最顶上的Fixed frame,手动输入 rviz左侧下方可添加显示的插件,选择添加pointcloud2,laserscan | |

2.配置launch文件

目录:~/carto_ws/cartographer_detailed_comments_ws/src/cartographer_ros/cartographer_ros/launch

2.1 bag文件的地址和bag文件的名字

cp lx_rs16_2d_outdoor_l.launch mytest.launch

修改 mytest.launch

复制代码
#1.修改default值

#1.<!--bag的地址与名称 -->
<arg name="bag_filename" default="$(env HOME)/bagfiles/rslidar-outdoor-gps.bag"


#2. 修改.lua文件

# $(find cartographer_ros)/configuration_files ~/carto_ws/cartographer_detailed_comments_ws/src/cartographer_ros/cartographer_ros/configuration_files
#<!--启动cartographer -->  修改lua文件
-configuration_directory $(find cartographer_ros)/configuration_files
-configuration_basename mytest.lua "


#3.修改点云 points2 单线雷达数据:scan  里程计odom
配置文件中的 与bag中的要一致

<remap from="scan" to="front_scan"/>  #front_scan
<remap from="odom" to="odom_scout"/>  #front_scan
<remap from="imu" to="imu"/>  #front_scan

2.2 lua文件的名字

2.3 topic需要remap成bag文件中发布的topic

3.配置Lua文件

cd:~/carto_ws/cartographer_detailed_comments_ws/src/cartographer_ros/cartographer_ros/configuration_files/

cp backpack_2d.lua mytest.lua

|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| | | |
| | tracking_frame: imu link base_link | imu_link |
| | published_frame cartographer: tf:最下边的一个坐标系 bag,tf树最上面一个坐标系 | odom |
| | provide_odom_frame:是否提供里程计 bag中有,此处为false | false |
| | use_pose_extrapolator :一定是false | false |
| | use_odometry:是否使用里程计的传感器数据,如果为true,tf树中存odom这个坐标系 | false |
| | use_nav_sat:是否使用GPS数据,true时会订阅gps的topic | false |
| | use_landmarks: | false |
| | num_laser_scans=1 #单线云 num_multi_echo_laser_scans=0 #多回声雷达 num_subdivisions_per_laser_scan=1 num_point_clouds=1 #多线点云 num_point_clouds 多线点云的话题的数量,可以同时为1,不可以同时为0 订阅话题的个数 {}内参数是有,的 外参数没有, | |
| | MAP_BUILDER.use_trajectory_builder_2d=true TRAJECTORY_BUILDER_2D.use_imu_data=true 是否使用imu, tracking_frame一定要设置成imu的link | |
| | TRAJECTORY_BUILDER_2D.min_z=-0.1 点云的最小z的范围,单线点云不能设置大于0的值(不设置),多线点云的这个值要大于0 | |

1.重新编译

cd ~/carto_ws/cartographer_detailed_comments_ws/

./catkin_make.sh

2.重新启动

roslaunch cartographer_ros mytest.launch

相关推荐
软件测试雪儿2 小时前
高频Postman软件测试面试题
测试工具·lua·postman
12程序猿1 天前
postman调用文件(.xlsm---带宏的excel文件)下载接口成功下载excel文件,浏览器访问下载文件打不开
excel·lua·postman
霜绛1 天前
Unity:lua热更新(三)——Lua语法(续)
unity·游戏引擎·lua
百***35942 天前
【Java EE】Spring请求如何传递参数详解
spring·java-ee·lua
SoleMotive.2 天前
redis实现漏桶算法--https://blog.csdn.net/m0_74908430/article/details/155076710
redis·算法·junit
꧁༺℘₨风、凌๓༻꧂3 天前
C# MES .NET Framework Winform 单元测试
单元测试·c#·.net
虹科网络安全3 天前
艾体宝干货 | Redis Python 开发系列#4 保证原子性与性能
redis·python·junit
我发在否3 天前
OpenResty > 平滑升级:1.25.x → 1.27.x
junit·openresty
IMPYLH3 天前
Lua 的 pairs 函数
开发语言·笔记·后端·junit·单元测试·lua
倚肆3 天前
Spring Boot 测试注解全解:从单元测试到集成测试
spring boot·单元测试·集成测试