Acknowledgement is sent back to RPI once Arduino has completed its movement. Upon receiving the acknowledgement, RPI will check the following:
1. Was the “terminate” button pressed?
2. Was the exploration completed?
According to the situation, the RPI will proceed on with the program (continuing exploring, send android the latest status of the robot).
# Movement from Arduino is completed elif(action_status.lower() == 'done'): print("Status DONE: terminated = " + terminate + "is_complete = " + is_complete) # Arduino to BT if(is_complete == '1'): print ("Exploration has completed") ToAndroid = [] action_status = "DONE" ToAndroid.extend([action_status,"","","",""]) Android_Msg = "|".join(ToAndroid) self.writeBT(Android_Msg) print ("Status IC/DONE, Arduino send to BT : %s" % Android_Msg) elif(terminate == '1'): print ("Terminated is called") ToAndroid = [] action_status = "DONE" ToAndroid.extend([action_status,"","","",""]) Android_Msg = "|".join(ToAndroid) self.writeBT(Android_Msg) print ("Status TE/DONE, Arduino send to BT: %s" %Android_Msg) # Arduino initiate SS back to Arduino else: print ("RPI ready for sensor information") ToArduino = [] action_status = "SS" ToArduino.extend([action_status,""]) Arduino_Msg = "|".join(ToArduino) self.writeSR(Arduino_Msg) print ("Status EX/DONE, RPI send to Arduino : %s" % Arduino_Msg)