The invention provides a robot indoor environment exploration,obstacle avoidance and target tracking method based on a ROS. Based on a grid map established through laser radar information,combined with local map deduction and global boundary searching,an independent exploration strategy is designed so that a moving robot can be prevented from getting into a local exploration infinite loop,and whole-indoor-environment exploration can be completely guaranteed. According to the method,real-time tracking nodes and shielding tracking nodes are designed with an improved Kalman filtering method and aMeanShift method in the ROS,the real-time problem and the complete-shielding problem of target tracking of the moving robot are solved,the computing speed of the system is increased,target search time is shortened,and the real-time requirement of tracking is met; when a target is completely shielded,the shielding tracking nodes forecast and track the target according to previous state information,and after shielding is ended,a target is newly locked,tracking modes are automatically switched,and the target is tracked through the real-time tracking mode.