Skip to content

Commit

Permalink
Updated profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulgoel873 committed Mar 4, 2024
1 parent 2e366a3 commit c86a847
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rb_ws/src/buggy/scripts/auton/autonsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def __init__(self,
self.rosrate = rospy.Rate(self.auton_rate)

self.profile = profile
self.tick_caller()
if self.profile:
cProfile.runctx('self.tick_caller()', globals(), locals(), sort="cumtime")
else:
self.tick_caller()

def update_self_odom(self, msg):
with self.lock:
Expand Down Expand Up @@ -151,10 +154,7 @@ def tick_caller(self):
self.distance_publisher.publish(Float64(distance))

# profiling
if self.profile:
cProfile.runctx('self.planner_tick()', globals(), locals(), sort="cumtime")
else:
self.planner_tick()
self.planner_tick()

self.local_controller_tick()

Expand Down

0 comments on commit c86a847

Please sign in to comment.