启动pb_rm

参考链接https://gitee.com/SMBU-POLARBEAR/pb_rm_simulation#https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Fstm32f303ret6%2Flivox_laser_simulation_RO2%2Fblob%2Fmain%2Fsrc%2Flivox_points_plugin.cpp

一.环境配置

1.克隆仓库(安装ROS2 humble)

git clone --recursive https://gitee.com/SMBU-POLARBEAR/pb_rmsimulation --depth=1

2.安装Livox SDK2

git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make -j
sudo make install

3.安装依赖

cd pb_rm_simulation

rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y

4.编译

colcon build --symlink-install

二.运行

在进行下面的代码之前要先设置环境变量

source /opt/ros/humble/setup.bash
source ~/pb_rm_simulation/install/setup.bash  #pb_rm_simulation这里要根据你自己的文件名进行更换

2.1.仿真模式

        边建图边导航

ros2 launch rm_nav_bringup bringup_sim.launch.py \
world:=RMUL \
mode:=mapping \
lio:=fastlio \
lio_rviz:=False \
nav_rviz:=True

        已知全局地图导航

ros2 launch rm_nav_bringup bringup_sim.launch.py \
world:=RMUL \
mode:=nav \
lio:=fastlio \
localization:=slam_toolbox \
lio_rviz:=False \
nav_rviz:=True

2.2.真实模式

Tips:

  1. 保存点云 pcd 文件:需先在 fastlio_mid360.yaml 中 将 pcd_save_en 改为 true,并设置 .pcd 文件的路径,运行时新开终端输入命令 ros2 service call /map_save std_srvs/srv/Trigger,即可保存点云文件。
  2. 保存地图:请参考 如何保存 .pgm 和 .posegraph 地图?。地图名需要与 YOUR_WORLD_NAME 保持一致。

         边建图边导航

ros2 launch rm_nav_bringup bringup_real.launch.py \
world:=YOUR_WORLD_NAME \
mode:=mapping  \
lio:=fastlio \
lio_rviz:=False \
nav_rviz:=True

         已知全局地图导航

ros2 launch rm_nav_bringup bringup_real.launch.py \
world:=YOUR_WORLD_NAME \
mode:=nav \
lio:=fastlio \
localization:=slam_toolbox \
lio_rviz:=False \
nav_rviz:=True

Tips: 栅格地图文件和 pcd 文件需具为相同名称,分别存放在 src/rm_nav_bringup/mapsrc/rm_nav_bringup/PCD 中,启动导航时 world 指定为文件名前缀即可。

2.3.小工具-键盘控制

ros2 run teleop_twist_keyboard teleop_twist_keyboard

三. 实车适配关键参数

  1. 雷达 ip

    本导航包已内置 livox_ros_driver2,可直接修改 MID360_config.json - lidar_configs - ip

  2. 测量机器人底盘正中心到雷达的相对坐标

    x, y 距离比较重要,将影响云台旋转时解算到 base_link 的坐标准确性

    填入 measurement_params_real.yaml

    若雷达倾斜放置,无需在此处填入 rpy,而是将点云旋转角度填入 MID360_config.json - extrinsic_parameter

  3. 测量雷达与地面的垂直距离

    此参数影响点云分割效果

    填入 segmentation_real.yaml - sensor_height

  4. nav2_params

    参数很多,比较重要的是 robot_radius 和 速度相关参数。详见 nav2官方文档

[INFO] [launch]: All log files can be found below /home/xinzhu/.ros/log/2025-10-09-20-05-23-734132-xinzhu-Lenovo-Legion-R9000P2021H-27261 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [rviz2-1]: process started with pid [27262] [rviz2-1] [ERROR] [1760011524.680511672] [rviz2]: PluginlibFactory: The plugin for class 'octomap_rviz_plugins/OccupancyGrid' failed to load. Error: According to the loaded plugin descriptions the class octomap_rviz_plugins/OccupancyGrid with base class type rviz_common::Display does not exist. Declared types are nav2_rviz_plugins/ParticleCloud rviz_default_plugins/AccelStamped rviz_default_plugins/Axes rviz_default_plugins/Camera rviz_default_plugins/DepthCloud rviz_default_plugins/Effort rviz_default_plugins/FluidPressure rviz_default_plugins/Grid rviz_default_plugins/GridCells rviz_default_plugins/Illuminance rviz_default_plugins/Image rviz_default_plugins/InteractiveMarkers rviz_default_plugins/LaserScan rviz_default_plugins/Map rviz_default_plugins/Marker rviz_default_plugins/MarkerArray rviz_default_plugins/Odometry rviz_default_plugins/Path rviz_default_plugins/PointCloud rviz_default_plugins/PointCloud2 rviz_default_plugins/PointStamped rviz_default_plugins/Polygon rviz_default_plugins/Pose rviz_default_plugins/PoseArray rviz_default_plugins/PoseWithCovariance rviz_default_plugins/Range rviz_default_plugins/RelativeHumidity rviz_default_plugins/RobotModel rviz_default_plugins/TF rviz_default_plugins/Temperature rviz_default_plugins/TwistStamped rviz_default_plugins/Wrench [ERROR] [launch]: Caught exception in launch (see debug for traceback): "package 'octomap_server' not found, searching: ['/home/xinzhu/nav_tutorial_ws/install/velocity_smoother_ext', '/home/xinzhu/nav_tutorial_ws/install/terrain_analysis_ext', '/home/xinzhu/nav_tutorial_ws/install/terrain_analysis', '/home/xinzhu/nav_tutorial_ws/install/sentry_bringup', '/home/xinzhu/nav_tutorial_ws/install/sensor_scan_generation', '/home/xinzhu/nav_tutorial_ws/install/ros2_livox_simulation', '/home/xinzhu/nav_tutorial_ws/install/rm_interfaces', '/home/xinzhu/nav_tutorial_ws/install/rm_decision_cpp', '/home/xinzhu/nav_tutorial_ws/install/pb_rm_simulation', '/home/xinzhu/nav_tutorial_ws/install/fast_lio', '/home/xinzhu/nav_tutorial_ws/install/livox_ros_driver2', '/home/xinzhu/nav_tutorial_ws/install/icp_relocalization', '/home/xinzhu/nav_tutorial_ws/install/costmap_intensity', '/home/xinzhu/nav_tutorial_ws/install/control_panel', '/home/xinzhu/nav_tutorial_ws/install/behaviortree_cpp', '/home/xinzhu/nav_tutorial_ws/install/behavior_ext_plugins', '/home/xinzhu/nav_tutorial_ws/install/auto_aim_interfaces', '/home/xinzhu/sentry_ws/install/terrain_analysis_ext', '/home/xinzhu/sentry_ws/install/terrain_analysis', '/home/xinzhu/sentry_ws/install/sentry_description', '/home/xinzhu/sentry_ws/install/sentry_bringup', '/home/xinzhu/sentry_ws/install/sensor_scan_generation', '/home/xinzhu/sentry_ws/install/rm_decision_cpp', '/home/xinzhu/sentry_ws/install/cmd_chassis', '/home/xinzhu/sentry_ws/install/rm_interfaces', '/home/xinzhu/sentry_ws/install/fast_lio', '/home/xinzhu/sentry_ws/install/livox_ros_driver2', '/home/xinzhu/sentry_ws/install/icp_relocalization', '/home/xinzhu/sentry_ws/install/costmap_intensity', '/home/xinzhu/sentry_ws/install/control_panel', '/home/xinzhu/sentry_ws/install/behaviortree_cpp', '/home/xinzhu/sentry_ws/install/behavior_ext_plugins', '/home/xinzhu/sentry_ws/install/auto_aim_interfaces', '/opt/ros/humble']"
10-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值