Planetary rover is the most efficient way to explore planets. The exploration area of planetary rover is a complex and unfamiliar environment. Planetary rover needs to perceive surrounding terrain and obstacle information clearly so as to ensure that the planetary rover can effectively and accurately perform autonomous obstacle avoidance and path planning in the unfamiliar environment. There is a problem that the slope is misjudged as an obstacle in autonomous obstacle avoidance, which leads to wrong planning decision. Meanwhile the passable area is treated as restricted area. Therefore, it is necessary to detect and estimate slope and identify the slope passing ability of planetary rover. A method for slope detection of planetary surface in the autonomous obstacle avoidance of planetary rover is presented in this paper. The down-sampling of original point cloud is processed by voxel mesh filtering. Meanwhile the real time 3D point cloud of large-scale planetary surface is clipped and segmented. The ground and obstacle are separated by local ground plane fitting estimation. Then slopes are calculated and classified, through which the slope above the threshold is reserved as obstacle and the slope below the threshold is set as passable area. The method presented in this paper is able to detect and classify the slope accurately in real time, which is shown in the simulation results.