Skip to content

Commit

Permalink
Changes for pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Jul 18, 2024
1 parent 8e09486 commit 40181b9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,7 @@ async def valid(self):
if not exists:
return False
value = await self.nh.get_param(self.param)
if not self._valid(value):
return False
return True
return self._valid(value)

async def reset(self):
if await self.exists():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,7 @@ def sanity_check(self, coordinate, timestamp):
return False

linear_velocity = rosmsg_to_numpy(self.last_odom.twist.twist.linear)
if np.linalg.norm(linear_velocity) > self.max_velocity:
return False

return True
return np.linalg.norm(linear_velocity) > self.max_velocity


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,7 @@ def _is_valid_contour(self, contour):
return False
self.last2d = self.rect_model.get_pose_2D(corners)
self.last_found_time_2D = self.image_sub.last_image_time
if self.do_3D and not self._get_pose_3D(corners):
return False
return True
return self.do_3D and not self._get_pose_3D(corners)

def _get_edges(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ def seth(x):

def out_range(self, bbox):
h, w, r = self.image.shape
if bbox[0] < 0 or bbox[0] + bbox[2] > w:
return True
if bbox[1] < 0 or bbox[1] + bbox[3] > h:
return True
return False
return (bbox[0] < 0 or bbox[0] + bbox[2] > w) or (
bbox[1] < 0 or bbox[1] + bbox[3] > h
)

def go(self):
while self.x is None:
Expand Down

0 comments on commit 40181b9

Please sign in to comment.