數據採集輸出(Data Acquisition Output)

前言大綱

從數據採集捕獲中存儲的數據可以通過機器人的 REST 端點下載。下載數據時,結果將在包含與發送到端點的特定查詢參數匹配的所有數據的 zip 文件中返回。

壓縮文件結構

包含來自遠程操作會話和名為“檢查”的任務運行的數據的示例 zip 文件:
downloaded_file.zip
└───teleop_2020-10-29T183020Z
│   │   metadata.json
│   │   basic-position-data.csv
│   │   detailed-position-data.csv
│   │   SpotCAM All 1 spot-cam-pano.jpg
│   │   SpotCAM All 1 spot-cam-ptz.jpg
│   │   SpotCAM ir nodata 2 spot-cam-ir.jpg
│       ...
└───2020-10-29T185610Z_Inspection
    │   metadata.json
    │   basic-position-data.csv
    │   detailed-position-data.csv
    │   SpotCAM All 1 spot-cam-pano.jpg
    │   SpotCAM All 1 spot-cam-ptz.jpg
    │   SpotCAM ir nodata 2 spot-cam-ir.jpg
        ...
存儲數據中的每個單獨組都將位於其自己的目錄中。目錄名稱將是 group_name,格式為 <mission start timestamp>_<mission name> 用於自動行走任務,或 teleop_<session start timestamp> 用於遙控捕獲。

在每個組的目錄中,作為該組一部分捕獲的圖像將使用 <action name> <image service name>-<image source name>.jpg 格式的文件名保存。將有一個 metadata.json 文件,其中包含在該組期間捕獲的所有相關元數據,以及用於基本或詳細位置數據的可選 CSV 文件(如果數據是在該組的操作期間捕獲的,則存在)。

Metadata.json 結構

json 數據是圍繞操作以及這些操作中的數據構建的。元數據要麼嵌套在與其關聯的數據中,要麼嵌套在捕獲它的操作中。

{
  "actions": [
    {
      // Identifier including the action name and timestamp.
      "action_id": {},
      // data captured during this action
      "data": {},
      // metadata associated with this action, but not any particular
      // piece of data.
      "metadata": {}
    },
    {
      "action_id": {},
      "data": {},
      "metadata": {}
    },
  ]
}

“數據”成員將包含映射到存儲在 zip 中的文件的條目,而“元數據”成員將包含與行動關聯的 json 數據。在行動的“數據”或“元數據”成員中,各個條目將存儲在具有通道名稱的成員內的列表中。通常,此列表中只有一個元素,除非您在特定捕獲行動期間將多個數據或元數據單獨存儲到同一通道。任何作為 AcquireDataRequest 元數據metadata 字段的一部分保存的 json 或 DataAcquisitionClient.acquire_data() 元數據metadata 參數都將保存在“元數據metadata”通道中。 Autowalk 動作標籤以這種方式存儲在“custom_metadata”成員中。

請注意,對於明確引用它們的元數據,這些數據或元數據可以有自己的一組“元數據”,其格式與操作的元數據相同。例如,捕獲 GPS 坐標將引用整個動作,但計算圖像中的邊界框將僅引用該特定圖像。
{ // beginning of an action in the "actions" list.
  "action_id": {},
  "data":{
    "some_image_channel": [
      {
        // Identifier for this image capture.
        "data_id": {},
        // Relative path to the image file.
        "filename": "...",
        // metadata associated with this particular image
        "metadata": {}
      }
    ],
    "another_channel": [
      {
        "data_id": {},
        "filename": "..."
      }
    ]
  },
  "metadata":{
    "basic-position-data": [
      {
        // Identifier for this basic-position-data capture.
        "data_id": {},
        // json representation of the data captured.
        "data": "...",
        // More metadata added later that refers to this particular metadata information.
        "metadata": {}
      }
    ],
    "my_metadata_channel": [
      {
        "data_id": {},
        "data": "...",
        "metadata": {}
      }
    ]
  }
}
來自任務範例的數據:
{
  "actions": [
    {// First capture action
      "action_id": {
        "timestamp": "2020-10-29T18:56:27.786897121Z",
        "group_name": "2020-10-29T185610Z_Inspection",
        "action_name": "SpotCAM All 1"
      },
    "data": { // Two images were captured at this action
      // One panoramic image on the "spot-cam-pano" channel
      "spot-cam-pano": [
        {
          "data_id": {
            "action_id": {
              "timestamp": "2020-10-29T18:56:27.786897121Z",
              "group_name": "2020-10-29T185610Z_Inspection",
              "action_name": "SpotCAM All 1"
            },
            "channel": "spot-cam-pano",
            // data_name is usually left empty like this.  It is used to differentiate captures
            // on the same channel at the same action, if needed.
            "data_name": ""
          },
          // filename is relative to this metadata.json file.
          "filename": "SpotCAM All 1 spot-cam-pano.jpg"
        }
      ],
      // One PTZ image on the "spot-cam-ptz" channel
      "spot-cam-ptz": [
        {
          "data_id": {
            "action_id": {
              "timestamp": "2020-10-29T18:56:27.786897121Z",
              "group_name": "2020-10-29T185610Z_Inspection",
              "action_name": "SpotCAM All 1"
            },
            "channel": "spot-cam-ptz",
            "data_name": ""
          },
          "filename": "SpotCAM All 1 spot-cam-ptz.jpg"
        }
      ]
    },
    // Metadata associated with the action itself, rather than a particular image.
    "metadata": {
      // Robot localization data saved on the "detailed-position-data" channel.
      "detailed-position-data": [
        {
          "data_id": {
            "action_id": {
              "timestamp": "2020-10-29T18:56:27.786897121Z",
              "group_name": "2020-10-29T185610Z_Inspection",
              "action_name": "SpotCAM All 1"
            },
          "channel": "detailed-position-data",
          "data_name": ""
        },
      "data": {
        "robot_kinematics": {
          "velocity_of_body_in_vision": {
            "angular": {
              "x": -0.0012627621181309223,
      ...
      ],
      // Autowalk tags saved on the "metadata" channel.
      "metadata": [
        {
          "data_id": {
            "action_id": {
              "timestamp": "2020-10-29T18:56:27.786897121Z",
              "group_name": "2020-10-29T185610Z",
              "action_name": "SpotCAM All 1"
            },
            "channel": "metadata",
            "data_name": ""
          },
          "data": {
            "custom_metadata": [
              "laptop1"
            ]
          }
        }
      ],
      ...

CSV結構

csv 文件將有一行用於群組中的每個文件。csv 文件的列將是 基本位置數據basic-position-data 或詳細位置數據detailed-position-data 元數據的扁平版本,以及在記錄期間輸入的任何自定義 Autowalk 標籤。

如果未為該文件捕獲數據,則條目將在一行中留空。


參考資料

特色、摘要,Feature、Summary:

關鍵字、標籤,Keyword、Tag:

留言

這個網誌中的熱門文章

Ubuntu 常用指令、分類與簡介

iptables的觀念與使用

網路設定必要參數IP、netmask(遮罩)、Gateway(閘道)、DNS

了解、分析登錄檔 - log

Python 與SQLite 資料庫

Blogger文章排版範本

Pandas 模組

如何撰寫Shell Script

查詢指令或設定 -Linux 線上手冊 - man

下載網頁使用 requests 模組