In a case out of Tyler, Texas, the interaction with the officer was deemed a "consensual encounter," despite the officer's statement to the defendant that his removal of petrified wood from a federal forest was illegal, because the defendant and officer joked during the conversation. Although the officer wore a uniform and had a badge and gun, there was no evidence that the officer subjected the defendant to physical force or a show of authority.
In order for someone's Miranda rights to apply, there has to be a "custodial interrogation." Typically, "custody" means when an objectively reasonable person would not feel free to leave. When that occurs, the police have to give your Miranda Warnings or the responses you give to their questions or "interrogation" are not admissable in a subsequent prosecution.