Welcome to the S.A.R.T. Jr. project, designed for new teams wishing to explore the Rapidly Manufactured Rescue Challenge, or RMRC, as a part of RoboCup. RMRC is a competition designed for students in RoboCup Junior who would like to see what extra skills and knowledge they need to eventually enter the Major Rescue leagues. This competition bridges the gap between Junior and Major rescue platforms, creating small and cost-effective robots perfect for use by first responders in disasters and emergency situations.
We are very proud of the platform we have built to support new teams. Below you will find a Assembly Guide, Python Code and both laser cutting and 3D printing files to make your very own S.A.R.T. Jr.! Please check back here regularly as we will continue to add more designs, added features and improvements based on user feedback. Good luck and happy roboting!
All files for the S.A.R.T. Jr. robot are available in both laser cutting and 3D printing configurations, allowing teams flexibility to manufacture this robot depending on what technologies they have available to them in their school or local makerspace. These files can be found through our Thingiverse page.
The following three files are all that is required to run the robot. The first code, run.sh, will run both the code for the motors and for the cameras. Save “main.py” and “Left Right Motor Control.py” before running the run.sh code.
1 2 3 4 | #!/bin/sh python3 main.py & python3 "Left Right Motor Control.py" killall python3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #Modified by smartbuilds.io #Date: 27.09.20 #Desc: This web application serves a motion JPEG stream # main.py # import the necessary packages from flask import Flask, render_template, Response, request from camera import VideoCamera import time import threading import os print("start") pi_camera = VideoCamera(flip=True) # flip pi camera if upside down. # App Globals (do not edit) app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') #you can customze index.html here def gen(camera): #get camera frame while True: frame = camera.get_frame() yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n') @app.route('/video_feed') def video_feed(): return Response(gen(pi_camera), mimetype='multipart/x-mixed-replace; boundary=frame') if __name__ == '__main__': print("ChECKTHIS") app.run(host='0.0.0.0', debug=False) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | #importing libraries import RPi.GPIO as GPIO import keyboard #The specific elements from the libraries you require from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) #Reading the pins where the specific motors are wired up to Motor1 = {'EN': 25, 'input1': 24, 'input2': 23} Motor2 = {'EN': 17, 'input1': 27, 'input2': 22} for x in Motor1: GPIO.setup(Motor1[x], GPIO.OUT) GPIO.setup(Motor2[x], GPIO.OUT) #Setting the speed in which the motors will spin EN1 = GPIO.PWM(Motor1['EN'], 100) EN2 = GPIO.PWM(Motor2['EN'], 100) #Start the motors as off EN1.start(0) EN2.start(0) print("keyboard running") while True: #If up arrow key is pressed if keyboard.is_pressed('Up'): print("Up key pressed") for x in range(40, 100): print ("FORWARD MOTION") EN1.ChangeDutyCycle(x) EN2.ChangeDutyCycle(x) #All motors move forwards GPIO.output(Motor1['input1'], GPIO.HIGH) GPIO.output(Motor1['input2'], GPIO.LOW) GPIO.output(Motor2['input1'], GPIO.HIGH) GPIO.output(Motor2['input2'], GPIO.LOW) #If down arrow key is pressed elif keyboard.is_pressed('Down'): for x in range(40, 100): print ("BACKWARD MOTION") EN1.ChangeDutyCycle(x) EN2.ChangeDutyCycle(x) #All motors move backwards GPIO.output(Motor1['input1'], GPIO.LOW) GPIO.output(Motor1['input2'], GPIO.HIGH) GPIO.output(Motor2['input1'], GPIO.LOW) GPIO.output(Motor2['input2'], GPIO.HIGH) #If left arrow key is pressed elif keyboard.is_pressed('Left'): for x in range(40, 100): print ("LEFT MOTION") EN1.ChangeDutyCycle(x) EN2.ChangeDutyCycle(x) #One motor moves forward, while the other moves backwards GPIO.output(Motor1['input1'], GPIO.LOW) GPIO.output(Motor1['input2'], GPIO.HIGH) GPIO.output(Motor2['input1'], GPIO.HIGH) GPIO.output(Motor2['input2'], GPIO.LOW) #If right arrow key is pressed elif keyboard.is_pressed('Right'): for x in range(40, 100): print ("RIGHT MOTION") EN1.ChangeDutyCycle(x) EN2.ChangeDutyCycle(x) #One motor moves backwards, while the other moves forwards GPIO.output(Motor1['input1'], GPIO.HIGH) GPIO.output(Motor1['input2'], GPIO.LOW) GPIO.output(Motor2['input1'], GPIO.LOW) GPIO.output(Motor2['input2'], GPIO.HIGH) else: #If no arrow keys are pressed, motors are off EN1.ChangeDutyCycle(0) EN2.ChangeDutyCycle(0) if keyboard.is_pressed('Ctrl+c'): exit() |