From c206bfb07f8f8416012fb747f53fd30e103d9160 Mon Sep 17 00:00:00 2001 From: Cameron Brown Date: Mon, 4 Sep 2023 12:12:40 -0400 Subject: [PATCH] small updates --- .../navigator_tools/object_database_helper.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/NaviGator/utils/navigator_tools/navigator_tools/object_database_helper.py b/NaviGator/utils/navigator_tools/navigator_tools/object_database_helper.py index 997f782fa..5cb8762cb 100644 --- a/NaviGator/utils/navigator_tools/navigator_tools/object_database_helper.py +++ b/NaviGator/utils/navigator_tools/navigator_tools/object_database_helper.py @@ -18,7 +18,7 @@ class DBHelper: Attributes: found (bool): checks whether the object is what the user has been looking for. - nh (object): processes database requests. + nh (axros.NodeHandle): processes database requests. position (int): the current position of the object. rot (): one of the dimensional values. new_object_subscriber (): an object that is being called from the database. @@ -34,7 +34,7 @@ def __init__(self, nh): Initialize the DB helper class. Args: - nh(): database object + nh(NodeHandle): NodeHandle object """ self.found = set() self.nh = nh @@ -52,10 +52,7 @@ async def init_(self, navigator=None): Initialize the axros parts of the DBHelper. Args: - navigator (object): a navigator object is passed in. - - Returns: - An object with set values is being returned. + navigator (NaviGator | None): Base NaviGator object """ # self._sub_database = yield self.nh.subscribe('/database/objects', PerceptionObjectArray, self.object_cb) self._database = self.nh.get_service_client("/database/requests", ObjectDBQuery) @@ -73,7 +70,7 @@ def _odom_cb(self, odom): Sets the position and the rot values. Args: - odom (object): odom, dimensional values, is being returned. + odom (object): Odom """ self.position, self.rot = nt.odometry_to_numpy(odom)[0] @@ -147,7 +144,7 @@ def set_looking_for(self, name): """ self.looking_for = name - def is_found_func(self): + def is_found_func(self) -> bool: """ Determines whether the object is being found or not. @@ -214,7 +211,7 @@ def stop_ensuring_object_permanence(self): """ self.ensuring_objects = False - def _wait_for_position(self, timeout=10): + def _wait_for_position(self, timeout=10) -> bool: """ A possible position is being stored in a variable. @@ -222,7 +219,7 @@ def _wait_for_position(self, timeout=10): timeout (int): time limit to retrieve something. Returns: - Determines whether the position is found within the time limit. + bool: Determines whether the position is found within the time limit. """ count = 0 while self.position is None: