Skip to content

Commit

Permalink
SAGE-1581: update manifest matching logic to use hardware model
Browse files Browse the repository at this point in the history
The 'name' field in the manifest is a free-form field and can be anything.
Instead use the 'hw_model' which is a more static value to identify
manifest cameras.
  • Loading branch information
jswantek committed Jan 12, 2023
1 parent 5e8ed9c commit 8917db7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import pandas

CAMERA_MODELS = ["XNV-8082R", "XNV-8080R", "XNP-6400RW", "XNF-8010RV", "XNV-8081Z"]


def create_dataframe():
"""Returns a dataframe representing the camera configuration table
Expand Down Expand Up @@ -52,7 +54,7 @@ def load_node_manifest(node_manifest_path):
with open(node_manifest_path, "r") as file:
manifest = json.load(file)
# this assumes all cameras in the manifest have the string "camera" in the "name"
m_cameras = [s for s in manifest["sensors"] if "camera" in s["name"]]
m_cameras = [s for s in manifest["sensors"] if s["hardware"]["hw_model"] in CAMERA_MODELS]
for m_cam in m_cameras:
data = {"state": "unknown", "model": m_cam["hardware"]["hw_model"]}
# this assumes the "name" of the camera is "<orientation>_camera" (ex. "top_camera")
Expand Down

0 comments on commit 8917db7

Please sign in to comment.