carla学习笔记2 传感器和数据
第四。传感器和数据
传感器是从周围环境中检索数据的参与者。它们对于为驾驶人创造学习环境至关重要。
本页总结了开始处理传感器所需的一切。它介绍了可用的类型及其生命周期的逐步指南。有关每个传感器的详细信息,请参阅传感器参考 .
- 传感器逐步
- 设置
- 产卵
- 听
- 数据
- 传感器类型
- 摄像机
- 探测器
- 其他
传感器逐步
类 carla.Sensor定义一种能够测量和流式传输数据的特殊类型的参与者。
- 这是什么数据?根据传感器的类型,其变化很大。所有类型的数据都继承自carla.SensorData .
- 他们什么时候检索数据?在每个模拟步骤上,或者在注册某个事件时。取决于传感器的类型。
- 他们如何检索数据?每个传感器都有
听()
方法来接收和管理数据。
尽管存在差异,但所有传感器的使用方式都是相似的。
设置
与其他参与者一样,找到蓝图并设置特定属性。这在处理传感器时至关重要。它们的属性将决定所获得的结果。这些在传感器参考 .
以下示例设置仪表板高清摄像头。
# Find the blueprint of the sensor.
blueprint = world.get_blueprint_library().find('sensor.camera.rgb')
# Modify the attributes of the blueprint to set image resolution and field of view.
blueprint.set_attribute('image_size_x', '1920')
blueprint.set_attribute('image_size_y', '1080')
blueprint.set_attribute('fov', '110')
# Set the time in seconds between sensor captures
blueprint.set_attribute('sensor_tick', '1.0')
产卵
附件
和附件类型
,是至关重要的。传感器应该连接到一个父参与者,通常是一个交通工具,跟踪它周围并收集信息。附件类型将决定其位置如何与所述车辆相关。
- 刚性连接移动对于其父位置是严格的。这是从模拟中检索数据的正确附件。
- 弹簧臂附件只需很少的加速和减速,运动就变得轻松了。此附件仅推荐用于录制模拟视频。移动是平滑的,并且在更新相机位置时避免了“跳跃”。
transform = carla.Transform(carla.Location(x= zero point eight, z= one point seven))sensor = world.spawn_actor(blueprint, transform, attach_to=my_vehicle)
重要的
使用附件生成时,位置必须相对于父参与者。
听
每个传感器都有listen()
方法。每次传感器检索数据时都会调用此函数。
参数callback是一个lambda函数. 它描述了在检索数据时传感器应该做什么。这必须将数据作为参数检索。
# do_something() will be called each time a new image is generated by the camera.
sensor.listen(lambda data: do_something(data))...# This collision sensor would print everytime a collision is detected.
def callback(event):for actor_id in event:vehicle = world_ref().get_actor(actor_id)print('Vehicle too close: %s' % vehicle.type_id)sensor02.listen(callback)
数据
大多数传感器数据对象都具有将信息保存到磁盘的功能。这将允许它在其他环境中使用。
传感器数据在传感器类型之间有很大的不同。看看传感器参考得到详细的解释。但是,所有这些都带有一些基本信息。
Sensor data attribute | Type | Description |
---|---|---|
frame
|
int | Frame number when the measurement took place. |
timestamp
|
double | Timestamp of the measurement in simulation seconds since the beginning of the episode. |
transform
|
carla.Transform | World reference of the sensor at the time of the measurement. |
注意:
is_listening
is a sensor attribute that enables/disables data listening at will.
sensor_tick
is a blueprint attribute that sets the simulation time between data received.
传感器类型
摄像机
从他们的角度看世界。helper类卡拉彩色转换器将修改所述图像以表示不同的信息。
- 检索数据每个模拟步骤
Sensor | Output | Overview |
---|---|---|
Depth | carla.Image | Renders the depth of the elements in the field of view in a gray-scale map. |
RGB | carla.Image | Provides clear vision of the surroundings. Looks like a normal photo of the scene. |
Semantic segmentation | carla.Image | Renders elements in the field of view with a specific color according to their tags. |
探测器
当数据附加到的对象注册特定事件时检索数据。
- 检索数据触发时
Sensor | Output | Overview |
---|---|---|
Collision | carla.CollisionEvent | Retrieves collisions between its parent and other actors. |
Lane invasion | carla.LaneInvasionEvent | Registers when its parent crosses a lane marking. |
Obstacle | carla.ObstacleDetectionEvent | Detects possible obstacles ahead of its parent. |
其他
不同的功能,如导航、物理特性测量和场景的二维/三维点地图。
- 检索数据每个模拟步骤
Sensor | Output | Overview |
---|---|---|
GNSS | carla.GNSSMeasurement | Retrieves the geolocation of the sensor. |
IMU | carla.IMUMeasurement | Comprises an accelerometer, a gyroscope, and a compass. |
LIDAR | carla.LidarMeasurement | A rotating LIDAR. Generates a 4D point cloud with coordinates and intensity per point to model the surroundings. |
Radar | carla.RadarMeasurement | 2D point map modelling elements in sight and their movement regarding the sensor. |
RSS | carla.RssResponse | Modifies the controller applied to a vehicle according to safety checks. This sensor works in a different manner than the rest, and there is specific RSS documentation for it. |
Semantic LIDAR | carla.SemanticLidarMeasurement | A rotating LIDAR. Generates a 3D point cloud with extra information regarding instance and semantic segmentation. |
这是一个传感器和如何检索模拟数据。
对卡拉的介绍到此结束。然而,还有很多东西要学。
carla学习笔记2 传感器和数据相关推荐
- JavaWeb黑马旅游网-学习笔记05【分类数据展示功能】
Java后端 学习路线 笔记汇总表[黑马程序员] JavaWeb黑马旅游网-学习笔记01[准备工作] JavaWeb黑马旅游网-学习笔记02[注册功能] JavaWeb黑马旅游网-学习笔记03[登陆和 ...
- 学习笔记(五)——数据适配器、数据表、数据网格视图控件的综合应用。
学习笔记(五)--数据适配器.数据表.数据网格视图控件的综合应用. 1. 批量修改 修改包括增加,删除以及更新3个操作,所以声明实力化3个SQL命令分别应用于插入,删除以及修改 将声明的SQL命令连 ...
- HALCON 20.11:深度学习笔记(3)---Data(数据)
HALCON 20.11:深度学习笔记(3)---Data(数据) HALCON 20.11.0.0中,实现了深度学习方法.其中,关于术语"数据"的介绍如下: 术语"数据 ...
- R学习笔记(4): 使用外部数据
来源于:R学习笔记(4): 使用外部数据 博客:心内求法 鉴于内存的非持久性和容量限制,一个有效的数据处理工具必须能够使用外部数据:能够从外部获取大量的数据,也能够将处理结果保存.R中提供了一系列的函 ...
- SDN软件定义网络 学习笔记(4)--数据平面
SDN软件定义网络 学习笔记(4)--数据平面 1. 简介 2. SDN数据平面架构 2.1 传统网络交换设备架构 2.2 SDN交换设备架构 2.3 数据平面架构图 3. SDN芯片与交换机 3.1 ...
- 【Vue】学习笔记-组件传值的数据累加器
[Vue]学习笔记-组件传值的数据累加器 前言 父级组件 购物车组件 计数器组件 常见错误总结 前言 组件传值的数据累加器可以分为三个部分 App.vue为父级组件 Carts.vue表示购物车 Co ...
- SQLite学习笔记(七)-- 数据插入、更新和删除(C++实现)
1.代码实例 代码说明 本例主要说明如何对数据表进行插入.更新和删除操作. 测试平台 1.开发语言:C++ 2.开发工具:VS2015 3.操作系统:Win7 X64 测试数据说明 测试表为Stude ...
- Python学习笔记---merge和concat数据合并(1)
Python学习笔记-merge和concat数据合并(1) Python学习笔记-merge和concat数据合并(2) 文章目录 Python学习笔记---merge和concat数据合并(1) ...
- 数据库学习笔记(一) | 数据(Data)的定义
数据库学习笔记(一) | 数据(Data)的定义和种类 什么是数据(Data) 结构化数据(Structured Data) 半结构化数据(Semi-structured Data) 非结构化数据(U ...
最新文章
- 幼儿园带括号算式口诀_初中数学必会的26个知识点口诀
- StatQuest学习笔记23——RNA-seq简介
- 使用sed和awk取除最后两个字段之外的字段
- 零基础Python学习路线图,小白的进阶之路!
- 【树莓派】树莓派SD卡系统镜像系统备份方法
- 全球及中国汽车卡钳行业产销需求现状与投资策略分析报告2022年版
- 【C++基础】异常匹配与内建异常类
- 自动驾驶3-2 安全保证和测试的行业方法 Industry Methods for Safety Assurance and Testing
- vs2017 社区版在不联网的电脑上注册方法
- 服务器系统日志应怎么查看,怎么查看服务器操作系统日志
- 恢复linux硬盘数据,Linux下的硬盘数据如何恢复?
- matlab里comb用法,comb_comb的意思和用法搭配
- 微信语音技术原理_微信语音电话是如何实现的?
- 【CTF WriteUp】2020电信和互联网行业赛个人赛部分Crypto题解
- svn提交代码报错:A conflict in the working copy obstructs the current operation,解决办法
- Qt--QMetaObject
- 超详细 PHP 开发环境配置:WampServer+ZendStudio+XDebug
- Composer用法详解
- Css Html / Summary of Interview Questions
- 假设计算机学院二年级,小吴到剧院去看喜剧表演,当一喜剧演员表演时,他笑得前仰后合。据了解,小吴几乎未曾为这个演员的表...