Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Command

Sample Requests

Sample Response / Description

getConfig

Code Block
languagejson
{
  "command": "getConfig"
}

Gets in memory configurations.

getSavedConfig

Code Block
languagejson
{
  "command": "getSavedConfig"
}

Gets on disk configurations.

saveConfig

Code Block
languagejson
{
  "command": "saveConfig"
}

Saves the in-memory configurations to the disk.

setConfig

Code Block
languagejson
{
  "command": "setConfig",
  "data": {
    "sources": {
      "optical": {
        "settings": {
          "port": 5005
        }
      }
    }
  }
}

Updates in-memory configurations. This API creates new key-value pairs, or updates the existing values. It doesn't save configurations to disk.

Note that in "data" you just need to specify the path to the json key to update:the example on the right would change the port to 5005 while everything else is left unchanged.

setConfigJsonPath

(available for JVC branch)

Code Block
languagejson
{
  "command": "setConfigJsonPath",
  "data": [
    {
      "path": "/sinks/prediction/20/settings/predictionIntervalMs",
      "value": 40
    }
  ]
}

Updates the in-memory configuration given JSON path, and new value.

For more info about JSON path, please refer JSON Pointer - JSON for Modern C++ (nlohmann.me).

overwriteConfig

(disabled in JVC branch)

Code Block
languagejson
{
  "command": "overwriteConfig",
  "data": {
    "settings": { ... },
    "sources": { ... },
    "sinks": { ... }
  }
}

Overwrites the in-memory configurations. This is suitable when user want to remove a key from the configuration.

getIntercalibrationStatus

Code Block
languagejson
{
  "command": "getIntercalibrationStatus"
}

Gets the current intercalibration status. Useful for refetching current status when the frontnend accidentally disconnects.

applyIntercalibrationResults

Code Block
languagejson
{
  "command": "applyIntercalibrationResults"
}

Applies the current intercalibration quaternion to the in-memory copy of config. This does not save to disk.

restartBackend

Code Block
languagejson
{
  "command": "restartBackend"
}

Restarts the backend. Internally the while loop reset the DataBlock, causing all sources and sinks to be freed from memory, and instantiate them again.

startRecording

Code Block
languagejson
{
    "command": "startRecording",
    "data": {
        "endpoints": ["inproc://imu_data_source_1"],
        "format": "json",
        "filename": "subaruDrive"
    }
}

Listens to data published to endpoints, and write to a file of YYYYMMDD-HHMMSS-{comment}.{format}

stopRecording

Code Block
{
    "command": "stopRecording",
}

Stops the current recording.

listRecording

Code Block
languagejson
{
    "command": "listRecording",
}

Lists the recorded filenames since the FusionHub booted up.

getVersion

Code Block
languagejson
{
  "command": "getVersion"
}
Code Block
languagejson
{
  "command": "getVersion",
  "status": "ok",
  "data": {
    "version": "1.0.0"
  }
}

...