日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

carla学习笔记2 传感器和数据

發布時間:2024/1/18 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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 attributeTypeDescription
frameintFrame number when the measurement took place.
timestampdoubleTimestamp of the measurement in simulation seconds since the beginning of the episode.
transformcarla.TransformWorld 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類卡拉彩色轉換器將修改所述圖像以表示不同的信息。

  • 檢索數據每個模擬步驟
SensorOutputOverview
Depthcarla.ImageRenders the depth of the elements in the field of view in a gray-scale map.
RGBcarla.ImageProvides clear vision of the surroundings. Looks like a normal photo of the scene.
Semantic segmentationcarla.ImageRenders elements in the field of view with a specific color according to their tags.

探測器

當數據附加到的對象注冊特定事件時檢索數據。

  • 檢索數據觸發時
SensorOutputOverview
Collisioncarla.CollisionEventRetrieves collisions between its parent and other actors.
Lane invasioncarla.LaneInvasionEventRegisters when its parent crosses a lane marking.
Obstaclecarla.ObstacleDetectionEventDetects possible obstacles ahead of its parent.

其他

不同的功能,如導航、物理特性測量和場景的二維/三維點地圖。

  • 檢索數據每個模擬步驟
SensorOutputOverview
GNSScarla.GNSSMeasurementRetrieves the geolocation of the sensor.
IMUcarla.IMUMeasurementComprises an accelerometer, a gyroscope, and a compass.
LIDARcarla.LidarMeasurementA rotating LIDAR. Generates a 4D point cloud with coordinates and intensity per point to model the surroundings.
Radarcarla.RadarMeasurement2D point map modelling elements in sight and their movement regarding the sensor.
RSScarla.RssResponseModifies 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 LIDARcarla.SemanticLidarMeasurementA rotating LIDAR. Generates a 3D point cloud with extra information regarding instance and semantic segmentation.

這是一個傳感器和如何檢索模擬數據。

對卡拉的介紹到此結束。然而,還有很多東西要學。

?

?

總結

以上是生活随笔為你收集整理的carla学习笔记2 传感器和数据的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。