flexbe_behavior_engine icon indicating copy to clipboard operation
flexbe_behavior_engine copied to clipboard

Behavior execution failed! ROS time moved backwards

Open tropappar opened this issue 4 years ago • 1 comments

I often (not always) get the error message

Behavior execution failed!
ROS time moved backwards

when executing a behavior state machine on board.

This is the exception traceback:

[/uav_0/behavior:local]: Traceback (most recent call last):
  File ".../flexbe/flexbe_behavior_engine/flexbe_onboard/src/flexbe_onboard/flexbe_onboard.py", line 132, in _behavior_execution
    result = self.be.execute()
  File ".../flexbe/flexbe_behavior_engine/flexbe_core/src/flexbe_core/behavior.py", line 165, in execute
    result = self._state_machine.spin()
  File ".../flexbe/flexbe_behavior_engine/flexbe_core/src/flexbe_core/core/state_machine.py", line 71, in spin
    self.sleep()
  File ".../flexbe/flexbe_behavior_engine/flexbe_core/src/flexbe_core/core/state_machine.py", line 85, in sleep
    self._current_state.sleep()
  File ".../flexbe/flexbe_behavior_engine/flexbe_core/src/flexbe_core/core/ros_state.py", line 22, in sleep
    self._rate.sleep()
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/timer.py", line 103, in sleep
    sleep(self._remaining(curr_time))
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/timer.py", line 163, in sleep
    raise rospy.exceptions.ROSTimeMovedBackwardsException(time_jump)
rospy.exceptions.ROSTimeMovedBackwardsException: ROS time moved backwards

tropappar avatar Jan 20 '22 13:01 tropappar

Questions:

  1. Is this real system hardware or simulation?
  2. What are you using for time sync between computers?

Do you think this just needs an exception handler block in ros_state.py line 22 and just continue on its way assuming the timer expired, or are there deeper issues that you are concerned with?

dcconner avatar Apr 28 '23 16:04 dcconner