In this paper, a bayesian framework for fault detection and isolation (FDI) based on kalman filtering is developed. Furthermore, in order to detect the faults affecting on the covariance matrix of the kalman filter, a real-time approach is presented. This proposed framework extracts the proper behavior of a mobile robot besides simultaneously localization and map building (SLAM). Actually the framework is a combination of the kalman filter and bayesian networks. Learning the model of the world is difficult. In particular when the system dynamics become nondeterministic, all aspects of the system cannot be directly observed and the sensors are subjected to noise. In many situations, learning a complete model is not possible. Therefore, only probabilistic models which are capable of taking uncertainty of sensors and environment can be employed. In this paper, we describe a framework as a composition between model-free and model-based systems. Model learning is perfectly based on bayesian network (BN) and fault detection is done by kalman filter. Experimental results show that the learned model outperforms the traditional BN. We demonstrate how the resulting algorithm can be used to detect faults in a complex system. Proposed method is not very sensitive to changing the map of robot. However, the Bayesian network and dynamic Bayesian network are very sensitive to changing the map and in the presence of the fault. The proposed method is tested in a real home environment with a mobile robot.