In this paper, a cooperative localization algorithm is proposed that considers the existence of obstacles in mobility-assisted wireless sensor networks (WSNs). In this scheme, a mobile anchor (MA) node cooperates with static sensor nodes and moves actively to refine location performance. The localization accuracy of the proposed algorithm can be improved further by changing the transmission range of mobile anchor node. The algorithm takes advantage of cooperation betweenMAs and static sensors while, at the same time, taking into account the relay node availability to make the best use of beacon signals. For achieving high localization accuracy and coverage, a novel convex position estimation algorithm is proposed, which can effectively solve the localization problem when infeasible points occur because of the effects of radio irregularity and obstacles. This method is the only range-free based convex method to solve the localization problem when the feasible set of localization inequalities is empty. Simulation results demonstrate the effectiveness of this algorithm.