If I were you, I would show up in court to contest the trespassing ticket because from what you write, it does not seem as though you had the intent to do what you were charged with doing. The policeman at the gated entry lulled you into a false sense of security and safety.Had you seen the "no trespassing" sign, most likely you would not have entered the area where you went. Had the police officer been doing his or her job, you would have been stopped as you were going in, inquiries made, you would have been advised of your inability to proceed and you most likely would have turned around without a ticket in hand.If I was the judge hearing your case, I wiuld be somethat sympathetic to your version of what transpired.Good luck.