The wording is pretty clear. Back then they were starting to get some 'machine guns' and they've had cannons and explosives for a while, any futurist was talking about such weaponry and machines that fought wars. They knew governments and other rich entities were going to have the first and most access to new weaponry and were going to use it to suppress any uprisings. They also knew any government, even their own, was going to become corrupt and heavy handed and eventually degrade into something akin to their monarchy with heavy taxation without representation (it only took 200 years for their own government to do that).
The right for the people to have a "well regulated militia" is pretty clear to me, it's a militia (which doesn't have to be controlled by any particular government) that is well-regulated (they have a purpose to exist and are under a command) shall not be infringed upon.
The right of the people to keep and bear arms shall not be infringed either. There is no statement there that clarifies what type of weaponry or when someone can bear arms because then an oppressive government could rule out eg. all automatic weapons or anyone who's not a leftie.
And does that mean that anyone can have a shotgun: yes, an ak-47: yes, an atomic or biological weapon: yes. The old government has it, why wouldn't a new government need it? And if an individual becomes a problem, the 'well regulated militia' can take care of it. If a group of individuals becomes a problem, we're talking about throwing over the old government, that was it's intended purpose.