Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
remove all logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljhan01 committed Jul 5, 2023
1 parent cd9ae2d commit 71e7fc8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion communication/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def send_turret_data(pos, vel, acc,
xAcc = acc['x_acc']
yAcc = acc['y_acc']
zAcc = acc['z_acc']
# logging.debug("Sending UART data at: ", str(time.localtime(time.time())))
send_message(TurretDataFormat.pack(xPos, yPos, zPos, xVel, yVel, zVel, xAcc, yAcc, zAcc, hasTarget), TurretDataFormat, MessageType.CMD_Turret_Aim)

def send_no_data():
Expand Down
2 changes: 1 addition & 1 deletion depth_calculation/depth_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def set_all_bounding_box_depth_values(self, box_list):

#check for invalid depth values
if(np.isnan(depth_value)):
# logging.warning("Invalid depth value")

invalid_depth_value = True
return invalid_depth_value

Expand Down
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import time
#begin initialization
def run_forever():
logging.basicConfig(filename='logging/error_logs', encoding='utf-8', level=logging.DEBUG)

RealSense = dp.RealSense()
RealSense.initialize_real_sense()
detector = od.object_detector()
Expand All @@ -29,15 +29,14 @@ def run_forever():
detector.run_object_detections(RealSense, boundingbox_list)

if(len(boundingbox_list)==0):
logging.debug("No detections, skipping frame")

com.send_no_data()
boundingbox_list.clear()
continue

is_depth_invalid = RealSense.set_all_bounding_box_depth_values(boundingbox_list)

if(is_depth_invalid):
# logging.warning("Invalid depth data", str(boundingbox_list))
com.send_no_data()
boundingbox_list.clear()
continue
Expand All @@ -46,9 +45,8 @@ def run_forever():

pos, vel, acc = object.select_target(boundingbox_list)

# logging.debug("pos, vel, acc: ", str(pos), str(vel), str(acc))
com.send_turret_data(pos, vel, acc, hasTarget=True)

boundingbox_list.clear()


Expand Down
3 changes: 1 addition & 2 deletions prediction/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ def sqrt_func(self, x):
result = np.linalg.cholesky(x)
except np.linalg.LinAlgError:
try:
# logging.warn("Nth Leading Minor not positive")

x = (x + x.T)/2
result = np.linalg.cholesky(x)
except np.linalg.LinAlgError:
# logging.warn("Nth Leading Minor still not positive")
x = posdef.nearestPD(x)
finally:
return result
Expand Down

0 comments on commit 71e7fc8

Please sign in to comment.