I pulled over to the side of the road to urinate. I turned my car off, took the keys out of the ignition and walked over to a fence. A highway patrol pulled up as I was walking to the fence and said he was pulling me over for speeding. Can I get a ticket when my car isn't on and I'm not inside of it. Am I technically a pedestrian at that point?
You were unlucky that the cop had nothing else better to do. You are lucky in that all you will have to do is pay a fine and go to traffic school. If the cop had cited you for indecent exposure you could have had to register for life as a sex offender.