Skip to content

Commit

Permalink
additional ledger details
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Apr 22, 2024
1 parent 3cff9f7 commit 4f443be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion skyscan-c2/c2_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,14 @@ def _target_selection_callback(
object_ledger_df = pd.read_json(
StringIO(object_ledger_json), convert_dates=False, convert_axes=False
)
object_ledger_df["age"] = time() - object_ledger_df["timestamp"]


if len(object_ledger_df):
### some logic to select which target
target = None
object_ledger_df["age"] = time() - object_ledger_df["timestamp"]
object_ledger_df["target"] = False
object_ledger_df["selectable"] = False

(
object_ledger_df["camera_pan"],
Expand Down Expand Up @@ -463,9 +466,11 @@ def _target_selection_callback(
]
if not target_ledger_df.empty:
logging.debug("Object[s] within distance threshold")
target_ledger_df["selectable"] = True
target = target_ledger_df.sort_values(
by="relative_distance", ascending=True
).iloc[0]
target["target"] = True
else:
logging.debug("No object[s] within distance threshold")
elif self.override_object and not object_ledger_df.empty:
Expand Down

0 comments on commit 4f443be

Please sign in to comment.