From e115b9278c0e8108795d45cec5e9db46f3548629 Mon Sep 17 00:00:00 2001 From: Daniel Parra Date: Sat, 28 Sep 2024 18:21:59 -0400 Subject: [PATCH] Increased radius of revolution, and commented out the await for classifier since we will need to set which props are which for now --- .../navigator_missions/wildlife_2024.py | 16 ++++++++++------ mil_common/axros | 2 +- ptk.txt | 2 -- 3 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 ptk.txt diff --git a/NaviGator/mission_control/navigator_missions/navigator_missions/wildlife_2024.py b/NaviGator/mission_control/navigator_missions/navigator_missions/wildlife_2024.py index 652858eed..66f685a9a 100644 --- a/NaviGator/mission_control/navigator_missions/navigator_missions/wildlife_2024.py +++ b/NaviGator/mission_control/navigator_missions/navigator_missions/wildlife_2024.py @@ -68,6 +68,11 @@ def object_classified(objects, obj_id): return i return -1 + def movement_finished(self, task): + if not task.cancelled(): + print("THE MOVEMENT HAS FINISHED") + self.current_move_task_state = MoveState.FINISHED + # Explore until we find one of the animals we have not seen before async def explore_closest_until(self, is_done, filter_and_sort)->dict: """ @@ -133,7 +138,6 @@ async def explore_closest_until(self, is_done, filter_and_sort)->dict: [rosmsg_to_numpy(obj.pose.position) for obj in objects], ) indices = [] if len(objects) == 0 else filter_and_sort(objects, positions) - print(f"\n\nINDICES: {indices}\n\n") if indices is None or len(indices) == 0: self.send_feedback("No objects") continue @@ -141,8 +145,8 @@ async def explore_closest_until(self, is_done, filter_and_sort)->dict: positions = positions[indices] # Exit if done - self.send_feedback(f"Analyzing objects: {objects}") ret = is_done(objects, positions) + self.send_feedback(f"Analyzing objects: {ret}") if ret is not None: if move_id_tuple is not None: self.send_feedback("Condition met. Canceling investigation") @@ -192,7 +196,7 @@ async def circle_animals(self, animals): label = object.labeled_classification # Go to point and Circle animal - await self.move.d_spiral_point(position, 5, 4, 1, + await self.move.d_spiral_point(position, 10, 4, 1, "cw" if label == "green_iguana_buoy" or label == "red_python_buoy" else @@ -207,13 +211,13 @@ def get_indices_of_most_confident_animals(self, objects, classifications=["red_p """Pass in sorted list of objects by distance from boat and extract the first instance of classifications""" animals_dict = {classif:-1 for classif in classifications} for i, obj in enumerate(objects): - print(obj) if obj.labeled_classification in classifications and animals_dict[obj.labeled_classification] == -1: animals_dict[obj.labeled_classification] = i return animals_dict async def find_wildlife(self): robot_position = (await self.tx_pose())[0] + self.send_feedback("FINDING WILDLIFE") def filter_and_sort(objects, positions): distances = np.linalg.norm(positions - robot_position, axis=1) @@ -264,7 +268,7 @@ async def run(self, args): self.objects_passed = set() await self.change_wrench("autonomous") # Wait a bit for PCDAR to get setup - await self.set_classifier_enabled.wait_for_service() - await self.set_classifier_enabled(SetBoolRequest(data=True)) + # await self.set_classifier_enabled.wait_for_service() + # await self.set_classifier_enabled(SetBoolRequest(data=True)) await self.nh.sleep(3.0) await self.find_wildlife() diff --git a/mil_common/axros b/mil_common/axros index a86842c93..30d6decda 160000 --- a/mil_common/axros +++ b/mil_common/axros @@ -1 +1 @@ -Subproject commit a86842c93370a62c0dad3fba0e6ef250137edf21 +Subproject commit 30d6decda1d6595d6a5d99ae78ed13845985a3af diff --git a/ptk.txt b/ptk.txt deleted file mode 100644 index 7e80360ef..000000000 --- a/ptk.txt +++ /dev/null @@ -1,2 +0,0 @@ -35748 -41321