Skip to content

Commit

Permalink
improved smoothness of system by reducing run check delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius-Juston committed Jan 25, 2024
1 parent aefe11b commit 8a09c5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/motion_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import rospy
from geometry_msgs.msg import Twist
from rospy import Rate
import time


class Robot:
Expand Down Expand Up @@ -86,9 +87,9 @@ def shutdown(self):

def run(self):
r = Rate(self.rate, reset=self._reset)
print self.rate

counter = 0
# s_time = time.time()

while not rospy.core.is_shutdown() and not self._shutdown:
if self._shutdown:
Expand All @@ -107,6 +108,8 @@ def run(self):
break
raise

# print self._period, time.time() - s_time


class SystemTasks:
def __init__(self, robot_groups):
Expand All @@ -128,7 +131,7 @@ def add_task(self, seconds, robot_group, robot_id=None, stop=False, **vel_comman
self.add_task(0, robot_group, robot_id=robot_id)

def run(self):
rate = Rate(1)
rate = Rate(10)

while not rospy.is_shutdown() and len(self.tasks) > 0:
for key, robot_tasks in self.tasks.items():
Expand Down

0 comments on commit 8a09c5e

Please sign in to comment.