Yep. The common myth is that 2A is for defence against tyranny, but it's clearly about having people armed and trained to be ready to fight if they're needed against an invading nation. That's what the military was in the day: militias, not standing armies.
2A is broken and shouldn't apply to the modern day, but that doesn't really matter. It doesn't matter why we are allowed to have weapons, just that we are and we should defend against those trying to intrude on the rights of others.