The answer most of the times is no, it's not legal. You can absolutely sleep in your car in the state of Florida. In order for the policeman to go past what's called a consensual encounter to invading your privacy, there has to be reasonable suspicion that you're about to commit a crime, have committed a crime, or will be committing a crime. The only exception to that is if objectively, the policeman looks at you and there is a reasonable basis for him to conclude that you're in some physical distress. He can at that point ask you to roll your window down or open the door.