Most certainly. If you can't afford it there are court appointed attorneys. I'm not sure how the payment goes for them, but if you can afford a personal lawyer its a much better option.
As for your situation I'll tell you some info that might be relevant. If a person ODs and 911 is called for them in the state of Taxxachusetts, the cops have no right to search, detain or charge anyone at the scene(edit: I should note that AFAIK that is only for drug charges, you can't have AK-47 laying out on the coffee table and have no worries). Its obviously a law intended to keep people from neglecting to call 911 during ODs in fear of being charged of a crime. Unfortunately your situation is a gray area where I am not sure about a few issues. For one you were in public, this might only be in the case of a private residence, not sure about that. Two, no one called 911, the police just showed up without a 911 call being entered. If a friend/relative/sig other or bystander came by, called 911 and then the police arrived (which they arrive to ODs before fire or EMS the majority of the time), your chances of being protected under that law might be better. Of course all these questions are reasons why you need counsel, on top of being taken at all seriously.