When police stop and search a pedestrian, this is commonly known as a stop and frisk. When police stop an automobile, this is known as a traffic stop. If the police stop a motor vehicle on minor infringements in order to investigate other suspected criminal activity, this is known as a pretextual stop. Additional rules apply to stops that occur on a bus.
Besides this being clearly unworkable, the requirements for the state providing public defense attorneys include being in need (you will need to provide an affadavit or similar to the effect) and when the defendant is at risk of significant time of confinement. The 5 to 15 minutes of the traffic or Terry stop are not considered significant. Nor are the processing times of arresting you and taking you in.
Trying to make the officer provide you with an attorney (or declaring you aren't doing anything without one) before complying with their orders may well result in your incarceration and subsequent assignment of a public defender.