Physicist Michio Kaku says we are 50 years away from the technology you’re talking about.
They just ran a contest worldwide to build a rescue/firefighting robot, and not only could they not think, they all fell over.
He said this in response to all those scientist last week calling for a ban on autonomous weapons.
He says we are a couple of generations away from having to worry about that.
Both the US and Israel (and maybe Russia) already have autonomy-capable weapon-systems (various drones and turrets), but between the horrendous PR and the fairly primitive capabilities of the systems ("is that a border-jumper or a goat-herder or a tumbleweed"), they aren't used as such. I think it will be sooner than a couple generations that they are deployed.