These are some ideas/a first approach for a Open Source License that allows other developers private and commercial use but excludes any kind of military use (e.g. for mobile robotic projects)
GPL can not be "extended" to be a Non-military license.
There is a Non-Miliary extension to GPL https://www.linux.com/news/open-source-project-adds-no-military-use-clause-gpl
There is a campaign to stop killer robots (this is only a part of non-military use): https://www.stopkillerrobots.org/
It is forbidden to use this Software in any system that is capable of killing a human beeing or cooperates with any system that is capable of that.
It is not allowed to use this Software in any System that has the intention to harm people. This includes any kind of reconnaissance or surveillance. This applies to any form of law enforcement and Military as well as any kind of organzation that designs or builds hard- or software systems for those purposses.
- should this exclude robots designed as first-aid responders e.g. to help army doctors or if the military is called for help during a natural desaster?
- a lot of research in the US is military funded? should this be excluded?
- what about robots that provide logistic support for the military?
- how is "harm people" defined? does this include surveillance?
- what about security systems?
- distinguish between harming and killing people? What about a light quadcopter drone that is not capable to harm a person but has the capability to injure someone.
- capability vs. intention - do not use in projects that are not CAPABLE of killing or do not use in systems that have the INTENTION to harm/kill people?
- RMS thinks free software and no-military contradicts each other (see here)