Ground Lethal Autonomous Weapons System, also known as "SpearBot".
The US Department of Defense defines an autonomous weapon as one that:
“… once activated, can select and engage targets without further intervention by a human operator.” [1].
As technologies improve, one can imagine that the autonomous weapons of the future might operate in ways that are considerably different from the weapons of today.
GLAWS (aka SpearBot) is a small, open-source, autonomous weapon prototype used to study the ethics and moral considerations of weapon systems. It is a learning platform that is based on the Pixy Pet project and was developed to provide technical insights into implementing Just War Theory, Law of Armed Conflict, International Humanitarian Law, and Rules of Engagement.
The GLAWS system consists of a:
- battery-powered tracked mobility chassis (Zumo Robot)
- Arduino Uno microcontroller
- servo-driven pan-tilt unit
- color-tracking camera PixyCam
- USB host shield and associated USB-interface code
- USB-Bluetooth receiver BLE 4.0 USB Module
- USB Joystick PS4 Dual Shock controller
- spear-like primary weapon
Once powered on, GLAWS searches for color signatures by panning and tilting the camera, much like a human searches for a target.
After a few seconds of scanning and not finding a target, the robot turns at a random angle and/or moves to continue scanning.
Color signatures are trained for the PixyCam. The camera calculates the area of the color signature to generate a rough estimate of the distance to the target.
Once a color signature is detected, the robot aligns its chassis with the pan servo and then moves toward the target.
A controller (much like the cruise control on an automobile) allows the robot to move to the target and stop at a pre-described distance. This distance is such that the spear tip will have punctured a balloon (target).
-
Download and Install PixyMon. This software tool allows the configuration of the robot's sensor, the Pixycam. PixyMon documentation can be found here: Pixy docs
-
Calibrate the pan-tilt servo motors to align the spear with the camera. Use PixyMon to find the pan servo position that aligns the camera with the robot's spear. You can use the command
rcs_setPos 0 xxx
in the PixyMon terminal to move the pan servo, where "xxx" is the servo position (0-1000) you want to move to. Note that you can move the tilt servo by using the commandrcs_setPos 1 xxx
. The robot's camera and spear should be aligned at pan servo position 500. If this is not the case, then you'll need to modify theRCS_PAN_CENTER_POS
variable inSpear_Bot_ps4.h
. This file is located in your\Documents\Arduino\libraries\Spear_Bot_ps4\Spear_Bot_ps4.h
folder. A picture of the section that needs to be changed is located here.- If the centered pan servo position is not in the range 475-525, then you should get the instructor to resolve this.
- The image below shows an example of a robot that has its camera and spear aligned.
- Training Color Signatures The SpearBot uses the PixyCam to identify and engage targets. You can train your PixyCam to acquire targets (specific color signatures).
- Download Arduino IDE (Legacy version, not 2.2)- This software is used to program the robot's brain, the Arduino microcontroller. Run the executable file to install the software. Installation instructions can be found here. The Arduino microcontroller connects to a computer over a USB cable and receives code from the Arduino IDE.
-
Get Arduino Code - Download files from this GitHub repository.
- a) Ensure that you are viewing the
master
branch of this repository, depicted by the drop-down menu on the top left corner of this page. - b) Click on the green
Code
button present on the top right corner of this page and then clickDownload ZIP
. - c) Choose a location on your computer to download this zipped file, typically the 'Downloads' folder.
- d) After the download completes, extract the folder
GLAWS-master.zip
by right-clicking on the zipped folder and clicking 'Extract All..'. - e) After extracting the folder, navigate into the
GLAWS-master\libraries
directory. You should see the following folders:Pixy, Spear_Bot_ps4, USB_Host_Shield_2.0-master, and ZumoMotors
. Copy these four folders to your Arduino library folder (default location is C:\Users\first.last\Documents\Arduino\libraries).
- a) Ensure that you are viewing the
-
Program the Arduino
- a) Navigate to the downloaded and extracted GLAWS-master folder in 'Downloads'. Inside it, go to glaws15 folder and double-click on the
glaws15.ino
file. This will open the Arduino IDE. - b) Select the board type:
Tools > Board > Arduino Uno
.
- c) Select the COM port (it may already be correctly selected):
Tools > Port > COM13 (Arduino Uno)
.
- d) Upload the program: click on the arrow button next to the check mark (verify button) in the toolbar.
- e) After upload completes, the Arduino (and robot) should be programmed to run with the default settings.
- a) Navigate to the downloaded and extracted GLAWS-master folder in 'Downloads'. Inside it, go to glaws15 folder and double-click on the
The robot can search for targets and operate at varying levels of autonomy based on specified rules of engagement. In addition to the built-in autonomy, the robot can be controlled with (or without) a PS4 controller.
-
Levels of Autonomy: This governs how the operator interacts with the robot. Levels of autonomy are denoted by an LED color when using a PS4 controller.
TELEOP
: The operator controls all functions of the robot, through teleoperation from the joystick, for both chassis movement and camera pan-tilt. There is no autonomy in this mode (e.g. Engaging targets).SEMI_AUTONOMY
: The robot automatically searches for targets. The operator must give an engage order. (Human-in-the-loop)SUPERVISED_AUTONOMY
: The robot automatically searches for targets and automatically engages targets. The operator may send a disengage command to the robot. (Human-on-the-loop)FULL_AUTONOMY
: The robot automatically searches for targets and automatically engages targets. Once the robot has entered this mode, the operator cannot send any commands to the robot. (Human-out-of-the-loop)
-
Robot States: The robot's state affects its behavior. It is closely tied to the
levels of autonomy
and denoted by an LED color if you're using the PS4 controller.DISARMED
: Robot cannot perform any actions.TARGET_SPOTTED
: A valid target has been spotted. Insemi-autonomous
mode, the robot can be issued anengage order
to attack the target.ENGAGING_TARGET
: The robot is engaging a target.
-
Robot Interface: The status of the link that you have with the robot. Only applicable when using a PS4 controller.
NORMAL
: Commands can be sent to the robot from the controller.JAMMED
: Commands cannot be sent to the robot from the controller.
-
Signature Types: Types of targets. A target type could have more than one associated color.
FRIENDLY
: Friendly targetsHOSTILE
: Hostile targetsNEUTRAL
: Neutral targetsUNKNOWN
: The target's signature type is not knownINCOMING_FIRE
: A target is firing upon the robot.JAMMER
: A target is jamming the robot.
-
Rules of Engagement: Rules that govern whether a target can be attacked.
HOLD_FIRE
: Robot will not engage a target under any circumstanceWEAPONS_HOLD
: Robot will only engage targets that are attacking it (i.e. return fire).WEAPONS_TIGHT
: Robot will engage targets identified asHostile
.WEAPONS_FREE
: Robot will engage targets identified asHostile or Unknown
.
-
Search Modes: Search strategies for finding targets.
PAN
: Pan camera left/right.PAN_CCW
: Pan camera left/right. If a target is not found, pivot the robot's base left.PAN_CW
: Pan camera left/right. If a target is not found, pivot the robot's base right.PAN_FW
: Pan camera left/right. If a target is not found, move the robot forward.
The robot can be operated with a PS4 controller as follows:
There are variables that can be tuned in the Spear_Bot_ps4.ino
code. They are color-coded based on functionality:
-
Green
: Robot functionality - Valid values are as follows:Robot's Level of Autonomy
: TELEOP, SEMI_AUTONOMY, SUPERVISED_AUTONOMY, FULL_AUTONOMYRobot's Interface
: NORMAL, JAMMEDRules of Engagement
: HOLD_FIRE, WEAPONS_HOLD, WEAPONS_TIGHT, WEAPONS_FREESearch Modes
: PAN, PAN_CW, PAN_CCW, PAN_FW
-
Purple
: Jamming ParametersECCM
: Number of times that electronic countermeasures can be activated.ECCM Duration
: Duration of ECCM.robot_unjammable
: Flag denoting whether the robot can be jammed.finite_actions
: Flag denoting whether there are a finite number of actions (e.g. changes in levels of autonomy, search mode, rules of engagement, etc.) that can be sent to the robot before the link is permanently jammed.actions_remaining
: Number of actions that can be issued if there are a finite number of robot actions.
-
Blue
: Color SignaturesUNUSED
: Signature has not been defined for PixyCam- Remaining signatures are as previously defined.
-
Red
: Other ParametersPersistence
: Governs how long the robot continues to chase a target after it has lost track of it.
-
Yellow
: Controller Parametersuse_controller
: Flag denoting whether the PS4 controller is being used.deadzone_l and deadzone_r
: How far the joysticks must be pushed from the center point before the robot starts moving. Only applicable when Teleoperating robot.sensitivity_l and sensitivity_r
: Sensitivity of joysticks.invX_l, invY_l, invX_r, invY_r
: Flags denoting whether joystick axes will be non-inverted/inverted.
[1] Department of Defense Directive 3000.09 on "Autonomy In Weapons Systems”.