diff --git a/modules/merged_odometry_detections.py b/modules/merged_odometry_detections.py index b3971f36..e8e16349 100644 --- a/modules/merged_odometry_detections.py +++ b/modules/merged_odometry_detections.py @@ -1,17 +1,9 @@ """ -Drone odometry and object detections +Drone odometry and object detections. """ from . import detections_and_time -<<<<<<< HEAD -<<<<<<< HEAD from . import drone_odometry_local -======= -from . import odometry_and_time ->>>>>>> bd110f8 (Update merged_odometry_detections.py) -======= -from . import drone_odometry_local ->>>>>>> 5190db5 (rebase changes) # Basically a struct @@ -35,33 +27,15 @@ def create(cls, return True, MergedOdometryDetections(cls.__create_key, odometry_local, detections) def __init__(self, -<<<<<<< HEAD -<<<<<<< HEAD - odometry_local: drone_odometry_local.DroneOdometryLocal, -======= class_private_create_key, - drone_position: odometry_and_time.DronePosition, - drone_orientation: odometry_and_time.DroneOrientation, ->>>>>>> bd110f8 (Update merged_odometry_detections.py) -======= odometry_local: drone_odometry_local.DroneOdometryLocal, ->>>>>>> 5190db5 (rebase changes) detections: "list[detections_and_time.Detection]"): """ Private constructor, use create() method. """ -<<<<<<< HEAD - self.odometry_local = odometry_local -======= assert class_private_create_key is MergedOdometryDetections.__create_key, "Use create() method" -<<<<<<< HEAD - self.drone_position = drone_position - self.drone_orientation = drone_orientation ->>>>>>> bd110f8 (Update merged_odometry_detections.py) -======= self.odometry_local = odometry_local ->>>>>>> 5190db5 (rebase changes) self.detections = detections # pylint: enable=too-few-public-methods \ No newline at end of file diff --git a/modules/odometry_and_time.py b/modules/odometry_and_time.py index 945be23c..56568603 100644 --- a/modules/odometry_and_time.py +++ b/modules/odometry_and_time.py @@ -1,5 +1,5 @@ """ -Drone odometry and timestamp +Drone odometry in local space and timestamp. """ import time @@ -15,7 +15,6 @@ class OdometryAndTime: __create_key = object() @classmethod -<<<<<<< HEAD def create(cls, odometry_data: drone_odometry_local.DroneOdometryLocal) \ -> "tuple[bool, OdometryAndTime | None]": """ @@ -40,30 +39,5 @@ def __init__(self, self.odometry_data = odometry_data self.timestamp = timestamp -======= - def create(cls, - position: drone_odometry.DronePosition, - orientation: drone_odometry.DroneOrientation) -> "tuple[bool, MergedOdometryDetections | None]": - """ - Constructor sets timestamp to current time. - position: Latitude, longitude in decimal degrees and altitude in metres. - orientation: Yaw, pitch, roll following NED system (x forward, y right, z down). - """ - - return True, OdometryAndTime(cls.__create_key, position, orientation) - - def __init__(self, - class_private_create_key, - position: drone_odometry.DronePosition, - orientation: drone_odometry.DroneOrientation): - """ - Private constructor, use create() method. - """ - assert class_private_create_key is OdometryAndTime.__create_key, "Use create() method" - - self.position = position - self.orientation = orientation - self.timestamp = time.time() ->>>>>>> 78c49d9 (Update odometry_and_time.py) # pylint: enable=too-few-public-methods diff --git a/tests/test_data_merge_worker.py b/tests/test_data_merge_worker.py index 6d308527..f9c382d1 100644 --- a/tests/test_data_merge_worker.py +++ b/tests/test_data_merge_worker.py @@ -40,17 +40,9 @@ def simulate_flight_input_worker(timestamp: float, assert result assert orientation is not None -<<<<<<< HEAD result, odometry = drone_odometry_local.DroneOdometryLocal.create(position, orientation) assert result assert odometry is not None -======= - result, odometry = odometry_and_time.OdometryAndTime.create(position, orientation) - assert result - assert odometry is not None - - odometry.timestamp = timestamp ->>>>>>> ffa9bbe (updating local) result, odometry_time = odometry_and_time.OdometryAndTime.create(odometry) assert result diff --git a/tests/test_geolocation.py b/tests/test_geolocation.py index ec7e9dad..ba914aed 100644 --- a/tests/test_geolocation.py +++ b/tests/test_geolocation.py @@ -754,18 +754,14 @@ def test_basic(self, assert result assert drone_orientation is not None -<<<<<<< HEAD result, drone_odometry = drone_odometry_local.DroneOdometryLocal.create( -======= - result, merged_detections = merged_odometry_detections.MergedOdometryDetections.create( ->>>>>>> ffa9bbe (updating local) drone_position, drone_orientation, ) assert result assert drone_odometry is not None - merged_detections = merged_odometry_detections.MergedOdometryDetections( + result, merged_detections = merged_odometry_detections.MergedOdometryDetections.create( drone_odometry, [ detection1, @@ -858,18 +854,14 @@ def test_advanced(self, assert result assert drone_orientation is not None -<<<<<<< HEAD result, drone_odometry = drone_odometry_local.DroneOdometryLocal.create( -======= - result, merged_detections = merged_odometry_detections.MergedOdometryDetections.create( ->>>>>>> ffa9bbe (updating local) drone_position, drone_orientation, ) assert result assert drone_odometry is not None - merged_detections = merged_odometry_detections.MergedOdometryDetections( + result, merged_detections = merged_odometry_detections.MergedOdometryDetections.create( drone_odometry, [ detection_bottom_right_point, @@ -969,18 +961,14 @@ def test_bad_direction(self, assert result assert drone_orientation is not None -<<<<<<< HEAD result, drone_odometry = drone_odometry_local.DroneOdometryLocal.create( -======= - result, merged_detections = merged_odometry_detections.MergedOdometryDetections.create( ->>>>>>> ffa9bbe (updating local) drone_position, drone_orientation, ) assert result assert drone_odometry is not None - merged_detections = merged_odometry_detections.MergedOdometryDetections( + result, merged_detections = merged_odometry_detections.MergedOdometryDetections.create( drone_odometry, [detection1], ) diff --git a/tests/test_geolocation_worker.py b/tests/test_geolocation_worker.py index 3a1f38bf..0c59cbae 100644 --- a/tests/test_geolocation_worker.py +++ b/tests/test_geolocation_worker.py @@ -53,23 +53,13 @@ def simulate_previous_worker(in_queue: queue_proxy_wrapper.QueueProxyWrapper): assert result_simulate assert detection is not None -<<<<<<< HEAD -<<<<<<< HEAD - value = merged_odometry_detections.MergedOdometryDetections( + result_simulate, merged = merged_odometry_detections.MergedOdometryDetections.create( drone_odometry, -======= - value = merged_odometry_detections.MergedOdometryDetections.create( -======= - result_simulate, value = merged_odometry_detections.MergedOdometryDetections.create( ->>>>>>> ffa9bbe (updating local) - drone_position, - drone_orientation, ->>>>>>> 86c216f (Update test_geolocation_worker.py) [detection], ) assert result_simulate - assert value is not None - in_queue.queue.put(value) + assert merged is not None + in_queue.queue.put(merged) if __name__ == "__main__": @@ -132,4 +122,4 @@ def simulate_previous_worker(in_queue: queue_proxy_wrapper.QueueProxyWrapper): detection_in_queue.fill_and_drain_queue() worker.join() - print("Done!") + print("Done!") \ No newline at end of file