Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when using create_task_routine with times before daily_start and daily_end #30

Open
heuristicus opened this issue Nov 1, 2016 · 0 comments

Comments

@heuristicus
Copy link
Contributor

With the setup

    start = time(6,00, tzinfo=localtz)
    end = time(17,45, tzinfo=localtz)

in routine_node.py, attempting to run rosrun tsc_routine routine_node.py will result in various crashes if the time specified in create_task_routine is outside the bounds of the start and end times.

The following

routine.create_task_routine(sweep_tasks_morning, daily_start = time(5,20, tzinfo=localtz), daily_end = time(12,00, tzinfo=localtz), repeat_delta = timedelta(minutes=45))

results in this error:

Traceback (most recent call last):
  File "/home/strands/michal_ws/src/g4s_deployment/tsc_routine/scripts/routine_node.py", line 87, in <module>
    routine.create_task_routine(sweep_tasks_morning, daily_start = time(5,20, tzinfo=localtz), daily_end = time(12,00, tzinfo=localtz), repeat_delta = timedelta(minutes=45))
  File "/home/strands/michal_ws/src/strands_executive_behaviours/routine_behaviours/src/routine_behaviours/robot_routine.py", line 571, in create_task_routine
    self.routine.repeat_every_delta(tasks, delta=repeat_delta, times=1, start_time=daily_start, duration=delta_between(daily_start, daily_end))
  File "/home/strands/michal_ws/src/strands_executive/task_executor/src/task_executor/task_routine.py", line 134, in repeat_every_delta
    self.repeat_every(tasks, window_start.timetz(), delta, times)
  File "/home/strands/michal_ws/src/strands_executive/task_executor/src/task_executor/task_routine.py", line 169, in repeat_every
    rospy.logwarn('Provided daily start %s is less than overall daily start %s. Clamping to daily start.' % (daily_start, self.daily_start))
  File "/usr/lib/python2.7/dist-packages/dateutil/tz.py", line 92, in utcoffset
    if self._isdst(dt):
  File "/usr/lib/python2.7/dist-packages/dateutil/tz.py", line 134, in _isdst
    + dt.second)
AttributeError: 'NoneType' object has no attribute 'toordinal'

The following

routine.create_task_routine(sweep_tasks_afternoon, daily_start = time(12,00, tzinfo=localtz), daily_end = time(18,30, tzinfo=localtz), repeat_delta = timedelta(minutes=45))

results in this error:

Traceback (most recent call last):
  File "/home/strands/michal_ws/src/g4s_deployment/tsc_routine/scripts/routine_node.py", line 88, in <module>
    routine.create_task_routine(sweep_tasks_afternoon, daily_start = time(12,00, tzinfo=localtz), daily_end = time(18,30, tzinfo=localtz), repeat_delta = timedelta(minutes=45))
  File "/home/strands/michal_ws/src/strands_executive_behaviours/routine_behaviours/src/routine_behaviours/robot_routine.py", line 571, in create_task_routine
    self.routine.repeat_every_delta(tasks, delta=repeat_delta, times=1, start_time=daily_start, duration=delta_between(daily_start, daily_end))
  File "/home/strands/michal_ws/src/strands_executive/task_executor/src/task_executor/task_routine.py", line 134, in repeat_every_delta
    self.repeat_every(tasks, window_start.timetz(), delta, times)
  File "/home/strands/michal_ws/src/strands_executive/task_executor/src/task_executor/task_routine.py", line 179, in repeat_every
    daily_duration = self.daily_end - daily_start
AttributeError: 'DailyRoutine' object has no attribute 'daily_end'
@heuristicus heuristicus changed the title Problems when using create_task_routine with times before daily_start and daily_end Problems when using create_task_routine with times before daily_start and daily_end Nov 1, 2016
@heuristicus heuristicus changed the title Problems when using create_task_routine with times before daily_start and daily_end Crash when using create_task_routine with times before daily_start and daily_end Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant