Skip to content

Commit

Permalink
fixed a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Feb 26, 2024
1 parent 9490051 commit f316b3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
23 changes: 9 additions & 14 deletions skyscan-c2/c2_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from datetime import datetime
from math import radians, cos, sin, asin, sqrt

import math
import numpy as np
import quaternion

import axis_ptz_utilities
from base_mqtt_pub_sub import BaseMQTTPubSub

Expand Down Expand Up @@ -100,7 +104,7 @@ def __init__(

# Compute the rotations from the geocentric (XYZ) coordinate
# system to the camera housing fixed (uvw) coordinate system
logging.info(f"Initial E_XYZ_to_uvw: {self.E_XYZ_to_uvw}")

(
self.q_alpha,
self.q_beta,
Expand All @@ -119,6 +123,7 @@ def __init__(
self.rho_c,
self.tau_c,
)
logging.info(f"Initial E_XYZ_to_uvw: {self.E_XYZ_to_uvw}")

# create MQTT client connection
self.connect_client()
Expand All @@ -145,25 +150,15 @@ def __init__(
"""
)

def _calculate_camera_angles(self, data: Any) -> tuple[float, float]:
# Calculate the relative tilt and pan angles of the object compared to the device
# Your calculation logic here
return relative_tilt, relative_pan
def _calculate_camera_angles(self: Any, data: Any) -> tuple[float, float]:
# Calculate the relative tilt and pan angles of the object compared to the device
# Your calculation logic here

"""
Process object message.
Returns
-------
None
"""
# Assign identifier, time, position, and velocity of the
# object
data = self.decode_payload(msg, "Selected Object")
if not set(
[
"object_id",
"object_type",
"timestamp",
"latitude",
"longitude",
Expand Down
1 change: 1 addition & 0 deletions skyscan-c2/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license = "Apache 2.0"
python = "^3.10"
schedule = "^1.1.0"
pandas = "^2.0.3"
numpy-quaternion==2022.4.2

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit f316b3d

Please sign in to comment.