Due to the extensive energy consumption and high population density in modern cities, the collection and use of scattered walking energy from the stream of people is crucial for the development of a green ecological city. Herein, a flexible undulated electrode-based triboelectric nanogenerator (u-TENG) was integrated to the floor to scavenge walking energy from pedestrians, promoting the ordered collection of disordered and scattered energy. Driven by the steps of human walking, the output of the as-fabricated u-TENG are an open-circuit voltage of 86 V and a short-circuit current of 6.2 μA, which are able to continuously light up 110 light-emitting diode bulbs. In addition, a self-powered location-tracking system was prepared for pedestrian volume counting and passenger tracing with the purpose of reducing energy consumption in public areas. The proposed walking energy harvesting device is flexible, feasible, and unaffected by season, climate, or location. This work not only proposes a strategy for mechanical energy harvesting in public areas, including subway stations, hospitals, shopping malls, and business streets, but also offers a novel solution for smart cities and low-carbon transportation alternatives.