Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix position and orientation usage in main_2024.py #162

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions main_2024.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import cv2
import yaml

from utilities.workers import queue_proxy_wrapper
from utilities.workers import worker_controller
from utilities.workers import worker_manager
from modules import odometry_and_time
from modules.detect_target import detect_target_worker
from modules.flight_interface import flight_interface_worker
from modules.video_input import video_input_worker
from utilities.workers import queue_proxy_wrapper
from utilities.workers import worker_controller
from utilities.workers import worker_manager



CONFIG_FILE_PATH = pathlib.Path("config.yaml")
Expand Down Expand Up @@ -135,16 +137,21 @@ def main() -> int:
except queue.Empty:
image = None

odometry_and_time = flight_interface_to_main_queue.queue.get()

if odometry_and_time is not None:
print("timestamp: " + str(odometry_and_time.timestamp))
print("lat: " + str(odometry_and_time.odometry_data.position.latitude))
print("lon: " + str(odometry_and_time.odometry_data.position.longitude))
print("alt: " + str(odometry_and_time.odometry_data.position.altitude))
print("yaw: " + str(odometry_and_time.odometry_data.orientation.yaw))
print("roll: " + str(odometry_and_time.odometry_data.orientation.roll))
print("pitch: " + str(odometry_and_time.odometry_data.orientation.pitch))
odometry_and_time_info: "odometry_and_time.OdometryAndTime | None" = \
flight_interface_to_main_queue.queue.get()

if odometry_and_time_info is not None:
timestamp = odometry_and_time_info.timestamp
position = odometry_and_time_info.odometry_data.position
orientation = odometry_and_time_info.odometry_data.orientation.orientation

print("timestamp: " + str(timestamp))
print("north: " + str(position.north))
print("east: " + str(position.east))
print("down: " + str(position.down))
print("yaw: " + str(orientation.yaw))
print("roll: " + str(orientation.roll))
print("pitch: " + str(orientation.pitch))
print("")

if image is None:
Expand Down
2 changes: 1 addition & 1 deletion modules/common
Loading