In recent years, the mobile robot has been the concern of numerous researcher since they are widely applied in various fields of daily life. This paper applies a virtual robot operating system (ROS) platform to develop a localization system for robot motion. The proposed system is based on the combination of relative and absolute measurement methods, in which the data from the encoder, digital compass, and laser scanner sensor are fused using the extended Kalman filter (EKF). The system also successfully eliminates the errors caused by the environment as well as the error accumulation. The experimental results show good accuracy and stability of position and orientation which can be further applied for the robot working in the indoor environment.