# how to fix freeze the video with ros

I integrated two algorithms , one of them object detection using tracking, second one robot navigation using self.move_base = actionlib.SimpleActionClient("move_base", MoveBaseAction)

when the detection algorithm loses the target, move_base immediately send the robot to the last position.

the issue sometime the detection algorithm loses the target short time about 2 second and move_base immediately send.

I need to wait 5 seconds before move_base send

this part from my code :

if detected_body:
self.controller1()

elif not detected_body and a[0] ==1 :
rospy.sleep()
self.controller2()


I used rospy.sleep() and while loop and for loop and everything here here but I cant fix it