Never give robots guns. Guns are for killing. Robots can’t make analogue decisions and those are the only ones that should ever control the taking of the life of another person. Robots make quantised decisions, not analogue ones. The quanta reflect the programming, and the programming arises from the approximation and modelling of a human view.
When a technologist embodies their or their employer’s view of what’s fair into a technology, any potential for the exercise of discretion is turned from a scale to a step and humanity is quantised. That quantisation of discretion is always in the interest of the person forcing the issue.
Calls for better robots that make better judgement calls are misguided and pointless. A robot that can successfully make life-or-death decisions is a piece of bad science fiction. Any technology that attempts to perform human judgement quantises discretion and inherently dehumanises culture. That technology should never have a weapon.