The last thing you want to do around a police officer is to act up, act nervous, or freeze. If you have ever been around someone who is acting nervous or suspicious, it probable makes you aware that something is not right and to be a little more vigilant with that person. Police officers are the same way and trained to pick on those clues. The only encounter that I have had with a police officer was a couple of summers ago, I was downtown and asked for directions to the outdoor Red Dress Party.
On occasion I have been asked for ID on entering a night club or while passing through TSA security to catch a flight. Never has been an issue.