美文网首页
LGSVL-运行车辆并设置车载传感器

LGSVL-运行车辆并设置车载传感器

作者: wangafu | 来源:发表于2020-04-10 09:55 被阅读0次

前言

根据LGSVL的官方快速上手教程安装运行simulator后,发现在模拟器内无法通过键盘控制车辆的运动。经学习了解后发现是需要在虚拟车辆中添加“keyboard control”的传感器,才可以通过键盘或罗技控制器控制车辆在虚拟环境中的运动。下面将会介绍如何设置“keyboard contorl”传感器以控制车辆,以及其它传感器的设置方式。

传感器添加方法

如下图所示,在模拟器的web GUI界面找到所使用的车辆,并点击设置按钮:



在打开后的界面中的sensor窗口中写入相应的传感器代码及其设置即可:



添加“keyboard contorl”传感器的代码如下:
[
 {
    "type": "Keyboard Control",
    "name": "Keyboard Car Control"
 }
]

将其粘贴到上图的传感器脚本框里面点击提交即可,然后再在场景中运行车辆即可。
TIPS

  • 需要在仿真里面打开交互模式仿真选项,如下图:


  • 在场景中运行车辆时需要先敲击右shift键,来关闭手刹才能通过上下左右键控制车辆运行。
  • PageUp键控制车辆加档,PageDown键控制车辆为倒挡。

其它传感器的添加方法

多传感器的json代码格式如下:

[
    SENSOR,
    SENSOR,
    SENSOR
]

单个SENSOR的格式如下:

{
    "type": STRING,
    "name": STRING,
    "params": {PARAMS},
    "parent": STRING,
    "transform": {
      "x": FLOAT,
      "y": FLOAT,
      "z": FLOAT,
      "pitch": FLOAT,
      "yaw": FLOAT,
      "roll": FLOAT,
    }
}
  • type为传感器的类型
  • name为传感器的名字,这决定了传感器将会如何定义
  • params为显示特定参数,如果没有设置的话是默认使用默认的值
  • parent为传感器连接至的上级传感器的transform
  • “transform”里的参数为其位置姿态转换信息。

具体地,某一搭载多传感器的车辆传感器代码示例如下:

[
  {
    "type": "CAN-Bus",
    "name": "CAN Bus",
    "params": {
      "Frequency": 10,
      "Topic": "/apollo/canbus/chassis"
    },
    "transform": {
      "x": 0,
      "y": 0,
      "z": 0,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "GPS Device",
    "name": "GPS",
    "params": {
      "Frequency": 12.5,
      "Topic": "/apollo/sensor/gnss/best_pose",
      "Frame": "gps"
    },
    "transform": {
      "x": 0,
      "y": 0,
      "z": -1.348649,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "GPS Odometry",
    "name": "GPS Odometry",
    "params": {
      "Frequency": 12.5,
      "Topic": "/apollo/sensor/gnss/odometry",
      "Frame": "gps"
    },
    "transform": {
      "x": 0,
      "y": 0,
      "z": -1.348649,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "IMU",
    "name": "IMU",
    "params": {
      "Topic": "/apollo/sensor/gnss/imu",
      "Frame": "imu",
      "CorrectedTopic": "/apollo/sensor/gnss/corrected_imu",
      "CorrectedFrame": "imu"
    },
    "transform": {
      "x": 0,
      "y": 0,
      "z": -1.348649,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "Radar",
    "name": "Radar",
    "params": {
      "Frequency": 13.4,
      "Topic": "/apollo/sensor/conti_radar"
    },
    "transform": {
      "x": 0,
      "y": 0.689,
      "z": 2.272,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "Lidar",
    "name": "Lidar",
    "params": {
      "LaserCount": 32,
      "MinDistance": 0.5,
      "MaxDistance": 100,
      "RotationFrequency": 10,
      "MeasurementsPerRotation": 360,
      "FieldOfView": 41.33,
      "CenterAngle": 10,
      "Compensated": true,
      "PointColor": "#ff000000",
      "Topic": "/apollo/sensor/velodyne64/compensator/PointCloud2",
      "Frame": "velodyne"
    },
    "transform": {
      "x": 0,
      "y": 2.312,
      "z": -0.3679201,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "Color Camera",
    "name": "Main Camera",
    "params": {
      "Width": 1920,
      "Height": 1080,
      "Frequency": 15,
      "JpegQuality": 75,
      "FieldOfView": 50,
      "MinDistance": 0.1,
      "MaxDistance": 1000,
      "Topic": "/apollo/sensor/camera/traffic/image_short/compressed"
    },
    "transform": {
      "x": 0,
      "y": 1.7,
      "z": -0.2,
      "pitch": 0,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "Color Camera",
    "name": "Telephoto Camera",
    "params": {
      "Width": 1920,
      "Height": 1080,
      "Frequency": 15,
      "JpegQuality": 75,
      "FieldOfView": 10,
      "MinDistance": 0.1,
      "MaxDistance": 1000,
      "Topic": "/apollo/sensor/camera/traffic/image_long/compressed"
    },
    "transform": {
      "x": 0,
      "y": 1.7,
      "z": -0.2,
      "pitch": -4,
      "yaw": 0,
      "roll": 0
    }
  },
  {
    "type": "Manual Control",
    "name": "Manual Car Control"
  },
  {
    "type": "Vehicle Control",
    "name": "Apollo Car Control",
    "params": {
      "Topic": "/apollo/control"
    }
  }
]

更多的传感器参数详解请看这里

https://www.lgsvlsimulator.com/docs/sensor-json-options/
https://github.com/lgsvl/simulator/issues/519

相关文章

  • LGSVL-运行车辆并设置车载传感器

    前言 根据LGSVL的官方快速上手教程安装运行simulator后,发现在模拟器内无法通过键盘控制车辆的运动。经学...

  • 09.Centos7搭建Nginx

    安装 启动Nginx并设置开机自动运行

  • LGSVL-运行场景或测试案例

    lgsvl场景运行方法 1.在模拟器目录下安装模拟器的Python API模块。 2.运行模拟器。3.设置环境变量...

  • 车载台

    车载台是指能安装在车辆、船舶、飞机等交通工具上,直接由外部电源供电的,并使用外部天线的无线电对讲机。中文名车载台用...

  • docker运行redis并设置密码

    docker运行redis并设置密码 准备工作 一台centos 7服务器或者虚拟机 安装好docker jdk ...

  • 为什么智能网联产业要立法?

    智能网联汽车是指搭载先进的车载传感器,控制器、执行器等装置,并融合现代通信与网络技术,实现车与车、路、人、云端等进...

  • Jenkins:2.使用

    环境 第一步:安装Docker 第二步:运行并设置Jenkins 1.下载镜像 2.运行 1.运行 2.登录并选择...

  • 车载传感器的接口

    名词解析 gige是指千兆以太网的技术标准gige poe是指带有供电功能的千兆以太网接口 接口形状还需要定义例如...

  • 如何从零设计车载语音软件功能

    随着车载智能硬件的联网普及,越来越多的车辆配装了语音识别功能。目前,在车载系统最重要的功能莫过于车载语音了,个人接...

  • Elasticsearch学习笔记(4)

    目录 搭建Elasticsearch 本节包括关于如何设置Elasticsearch并使其运行的信息,包括: 下载...

网友评论

      本文标题:LGSVL-运行车辆并设置车载传感器

      本文链接:https://www.haomeiwen.com/subject/phthmhtx.html