Skip to content

Rosbag 重放模拟#

步骤#

  1. 下载并解压缩示例地图.

    • 您也可以手动下载 地图.
    gdown -O ~/autoware_map/ `https://docs.google.com/uc?export=download&id=1A-8BvYRX3DhSzkAnOcGWFw5T30xTlwZI`
    unzip -d ~/autoware_map/ ~/autoware_map/sample-map-rosbag.zip
    
  2. 下载示例 rosbag 文件.

    gdown -O ~/autoware_map/ `https://docs.google.com/uc?export=download&id=1sU5wbxlXAfHIksuHjP3PyI2UVED8lZkP`
    unzip -d ~/autoware_map/ ~/autoware_map/sample-rosbag.zip
    
  3. 检查你是否有 ~/autoware_data 文件夹和文件.

    $ cd ~/autoware_data
    $ ls -C -w 30
    image_projection_based_fusion
    lidar_apollo_instance_segmentation
    lidar_centerpoint
    tensorrt_yolo
    tensorrt_yolox
    traffic_light_classifier
    traffic_light_fine_detector
    traffic_light_ssd_fine_detector
    yabloc_pose_initializer
    

    如果没有,请按照 手动下载工件 进行作.

注意#

  • 样本地图和rosbag:版权所有 2020 TIER IV, Inc.
  • 出于隐私考虑,rosbag 不包含图片数据,这会导致:
    • 无法使用此示例 rosbag 测试交通灯识别功能.
    • 目标检测精度降低.

如何运行 rosbag 重放模拟#

使用 Autoware Launch GUI

如果您更喜欢使用图形用户界面 (GUI) 而不是命令行来启动和管理仿真,请参阅本文档末尾的 使用 Autoware Launch GUI 部分,以获取分步指南.

  1. 启动 Autoware.

    source ~/autoware/install/setup.bash
    ros2 launch autoware_launch logging_simulator.launch.xml map_path:=$HOME/autoware_map/sample-map-rosbag vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
    

    请注意,您不能在此处使用 ~ 而不是 $HOME.

    after-autoware-launch

    ⚠️ 在播放 rosbag 之前,您可能会在终端中遇到错误和警告消息.这是正常行为.一旦播放 rosbag 并进行适当的初始化,这些作就会停止

  2. 播放示例 rosbag 文件.

    source ~/autoware/install/setup.bash
    ros2 bag play ~/autoware_map/sample-rosbag/ -r 0.2 -s sqlite3
    

    由于 rosbag 中的时间戳与当前系统时间戳之间存在差异,Autoware 可能会在终端中生成警告消息,提醒这种不匹配.这是正常行为.

    after-rosbag-play

  3. 要将视图聚焦在自主车辆上,请将 RViz 视图面板中的 Target Frameviewer 更改为 base_link .

    change-target-frame

  4. 要将视图切换到 Third Person Follower 等,请在 RViz 视图面板中更改 Type .

    third-person-follower

参考视频教程

使用 Autoware Launch GUI#

本节提供了使用 Autoware Launch GUI 启动和管理 rosbag 重放模拟的分步指南.提供了上一节中提供的命令行说明的替代方法.

Autoware Launch GUI 入门#

  1. 安装: 确保您已安装 Autoware Launch GUI.安装说明.

  2. 启动 GUI: 从应用程序菜单中打开 Autoware Launch GUI. GUI_screenshot_for_launching

启动日志记录模拟#

  1. 设置 Autoware 路径: 在 GUI 中,设置 Autoware 安装的路径. GUI_screenshot_for_setting_Autoware_path

  2. 选择 Launch File(启动文件): 选择 logging_simulator.launch.xml 作为车道行驶场景. GUI screenshot for selecting launch file

  3. 自定义参数: 根据需要调整 map_pathvehicle_modelsensor_model 等参数.

    GUI screenshot for customizing parameters GUI screenshot for customizing parameters

  4. 开始模拟: 单击启动按钮开始模拟并访问所有日志.

    GUI screenshot for starting simulation

  5. 播放 Rosbag: 移动到 Rosbag 选项卡并选择您要播放的 rosbag 文件.

    GUI screenshot for selecting rosbag file

  6. 调整播放速度: 根据需要调整播放速度和您希望自定义的任何其他参数.

    GUI screenshot for adjusting playback speed

  7. 开始播放: 单击播放按钮开始 rosbag 播放,并可以访问 pause/playstopspeed slider 等设置5.

    GUI screenshot for starting playback

  8. 查看模拟: 移动到 RViz 窗口以查看模拟.

    after-rosbag-play

  9. 要将视图聚焦在自我车辆上,请将 RViz 视图面板中的 Target Frameviewer 更改为 base_link.

    change-target-frame

  10. 要将视图切换到 Third Person Follower 等,请在 RViz 视图面板中更改 Type.

    third-person-follower