Slide 1

Slide 1 text

ROBOTICS 101

Slide 2

Slide 2 text

ANDREW NESBITT

Slide 3

Slide 3 text

MY ROBOT STORY

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

BEng Robotics & Automated Systems University of Plymouth

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Advanced Mathematics Mechanical Engineering Digital Electronics Analogue Electronics Computer Science Control Theory Neural Networking Microprocessor Design Playing with Robots LEARNING ROBOTICS

Slide 10

Slide 10 text

Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Advanced Mathematics Observing Robots behind glass LEARNING ROBOTICS

Slide 11

Slide 11 text

Robotics was expensive, complicated and not fun

Slide 12

Slide 12 text

APIs Open Source Hardware Smart phones Dynamic Programming Languages GitHub Mobile Internet 3D Printing 2014

Slide 13

Slide 13 text

robot /ˈrəʊbɒt/ a machine capable of carrying out a complex series of actions automatically, especially one programmable by a computer.

Slide 14

Slide 14 text

FICTIONAL ROBOTS ENTERTAINMENT ROBOTS

Slide 15

Slide 15 text

INDUSTRIAL ROBOTS

Slide 16

Slide 16 text

DOMESTIC ROBOTS

Slide 17

Slide 17 text

MEDICAL ROBOTS

Slide 18

Slide 18 text

HOBBY ROBOTS

Slide 19

Slide 19 text

EDUCATIONAL ROBOTS

Slide 20

Slide 20 text

MILITARY ROBOTS

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

It's a UNIX system! I know this!

Slide 23

Slide 23 text

LEGO

Slide 24

Slide 24 text

EV3

Slide 25

Slide 25 text

ROBOT RABBIT FEEDER

Slide 26

Slide 26 text

! var Ev3 = require ("ev3-nodejs-bt");
 var Ev3_base = Ev3.base;
 
 var XboxController = require('xbox-controller');
 var xbox = new XboxController;
 
 var robot = new Ev3_base("/dev/tty.EV3-SerialPort");
 
 var maxAngle = 32768;
 var maxSpeed = 100;
 
 var speeds = { a: 0, b: 0, c: 0, d: 0 };

Slide 27

Slide 27 text

! robot.connect(function(){
 robot.start_program(function(ev3){
 var setSpeed = function(){
 var output = ev3.getOutputSequence(speeds.a,speeds.b,speeds.c,speeds.d);
 ev3.sp.write(output);
 }
 
 setInterval(setSpeed, 100)
 
 xbox.on('left:move', function(position){
 var x = -(position.x / maxAngle)*-maxSpeed
 var y = (position.y / maxAngle)*-maxSpeed
 
 var left = y-x
 var right = y+x
 
 speeds.b = left
 speeds.a = right
 })
 
 xbox.on('a:press', function(){
 speeds.d = 100
 })
 
 xbox.on('a:release', function(){
 speeds.d = 0
 })
 });
 });


Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

github.com/andrew/node-ev3-robot

Slide 31

Slide 31 text

github.com/clebert/ev3

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

ARDUINO

Slide 34

Slide 34 text

FIRMATA

Slide 35

Slide 35 text

Cat Laser Toy

Slide 36

Slide 36 text

Cat Laser Toy Rabbit | v

Slide 37

Slide 37 text

Demo Time

Slide 38

Slide 38 text

Demo Time

Slide 39

Slide 39 text

Demo Time

Slide 40

Slide 40 text

Demo Time

Slide 41

Slide 41 text

Demo Time

Slide 42

Slide 42 text

Demo Time

Slide 43

Slide 43 text

Demo Time

Slide 44

Slide 44 text

Demo Time

Slide 45

Slide 45 text

Demo Time

Slide 46

Slide 46 text

! var five = require("johnny-five"),
 board = new five.Board();
 
 function randomFromInterval(from,to){
 return Math.floor(Math.random()*(to-from+1)+from); 
 }
 
 board.on("ready", function() {
 var servoX = new five.Servo(10);
 var servoY = new five.Servo(9);
 var laser = new five.Led(8);
 
 laser.on()
 
 setInterval(function(){
 x = randomFromInterval(80, 120)
 y = randomFromInterval(95, 145)
 servoX.move(x)
 servoY.move(y)
 }, 400)
 }) 


Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

hobbytronics.co.uk/sparkfun-inventors-kit-v3 Sparkfun Inventors Kit

Slide 49

Slide 49 text

node-ardx.org

Slide 50

Slide 50 text

hobbytronics.co.uk/zumo-robot-kit

Slide 51

Slide 51 text

var five = require("johnny-five"), board = new five.Board(); ! var Zumo = function(){ this.leftMotor = new five.Motor({ pins: { pwm: 10, dir: 8 } }); ! this.rightMotor = new five.Motor({ pins: { pwm: 9, dir: 7 } }); ! this.move = function(x,y){ var left = y-x var right = y+x ! if(left > 0){ this.leftMotor.reverse(left) } else { this.leftMotor.forward(-left) } ! if(right > 0){ this.rightMotor.reverse(right) } else { this.rightMotor.forward(-right) } } }

Slide 52

Slide 52 text

var XboxController = require('xbox-controller'), xbox = new XboxController; ! maxAngle = 32768 maxSpeed = 255 ! board.on("ready", function() { var zumo = new Zumo ! var x = 0 var y = 0 ! xbox.on('left:move', function(position){ x = (position.x / maxAngle)*-maxSpeed zumo.move(x,y) }) ! xbox.on('lefttrigger', function(position){ y = -position zumo.move(x,y) }) ! xbox.on('righttrigger', function(position){ y = position zumo.move(x,y) }) })

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

AUTONOMOUS ROBOTS

Slide 55

Slide 55 text

CONTROL LOOPS

Slide 56

Slide 56 text

INPUTS ! PROCESSING ! OUTPUTS

Slide 57

Slide 57 text

AUDIO, VISION, MOTION, TEMPERATURE, POSITION, DISTANCE, TOUCH, FORCE, MAGNETIC, LIGHT, VIBRATION, MOISTURE, PRESSURE, PROXIMITY, CHEMICAL, ELECTRICAL, COLOR AND MORE INPUT SENSORS

Slide 58

Slide 58 text

WHEELS, GRIPPERS, ARMS, ROTORS, SERVOS, LIGHTS, SOUNDS,VISUALS, SWITCHES, RELAYS OUTPUTS

Slide 59

Slide 59 text

ELECTRICAL CIRCUITS, MICROCONTROLLERS, COMPUTERS, SERVER FARMS PROCESSING

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

npm install cylon

Slide 63

Slide 63 text

var Cylon = require('cylon'); ! Cylon.robot({ connection: { name: 'sphero', adaptor: 'sphero', port: '/dev/cu.Sphero-GGP-AMP-SPP' }, device: { name: 'sphero', driver: 'sphero' }, ! work: function(my) { var color = 0x00FF00, bitFilter = 0xFFFF00; ! after((1).seconds(), function() { console.log("Setting up Collision Detection..."); my.sphero.detectCollisions(); my.sphero.setDataStreaming(['locator', 'accelOne', 'velocity'], { n: 200, m: 1, pcnt: 0,}); my.sphero.setBackLED(255); my.sphero.setRGB(color); my.sphero.stop(); every(5..seconds(), function() { my.sphero.roll(128, Math.floor(Math.random() * 360)); }); }); ! my.sphero.on('data', function(data) { app.io.broadcast('draw', {color:color.toString(16), x:data[0], y:data[1]}) }); ! my.sphero.on('collision', function(data) { color = color ^ bitFilter; my.sphero.setRGB(color); my.sphero.roll(128, Math.floor(Math.random() * 360)); app.io.broadcast('collision', {color:color.toString(16)}) }); ! } }).start();

Slide 64

Slide 64 text

// Input my.sphero.on('collision', function(data) { // Processing color = color ^ bitFilter; direction = Math.floor(Math.random() * 360) // Output my.sphero.roll(128, direction); my.sphero.setRGB(color); app.io.broadcast('collision', {color:color.toString(16)}) }); ! ! ! // Input my.sphero.on('data', function(data) { ! // Processing if(Math.abs(data[0]) > 1000 || Math.abs(data[1]) > 1000) { // Output my.sphero.roll(128, Math.abs(direction - 180)); } ! // Output app.io.broadcast('draw', {color:color.toString(16), x:data[0], y:data[1]}) });

Slide 65

Slide 65 text

var express = require('express.io') var app = express().http().io() ! app.get('/', function(req, res) { res.sendfile(__dirname + '/client.html') }) ! app.listen(7076)

Slide 66

Slide 66 text

App = {} App.socket = io.connect() ! var startX = 950; var startY = 500; ! var previousX = 950; var previousY = 500; ! App.draw = function(data) { App.ctx.beginPath() App.ctx.moveTo(previousX, previousY); App.ctx.lineWidth = 5; App.ctx.lineTo(data.x+startX,data.y+startY) App.ctx.strokeStyle = "#" + data.color App.ctx.stroke() previousX = data.x+startX; previousY = data.y+startY; } ! App.socket.on('draw', App.draw) ! $(function() { App.ctx = $('canvas')[0].getContext("2d") })

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

ARDRONE AUTONOMY

Slide 72

Slide 72 text

PID CONTROLLER KALMAN FILTER CAMERA PROJECTION MISSION PLANNER

Slide 73

Slide 73 text

PID CONTROLLER

Slide 74

Slide 74 text

// Plan mission mission.takeoff() .zero() .hover(500) .altitude(3) .forward(2) .right(2) .backward(2) .go({x:0, y:0}) .hover(500) .land(); ! // Execute mission mission.run(function (err, result) { if (err) { console.trace("Oops: %s", err.message); mission.client().stop(); mission.client().land(); } else { console.log("We are done!"); process.exit(0); } });

Slide 75

Slide 75 text

! // Land on ctrl-c var exiting = false; process.on('SIGINT', function() { if (exiting) { process.exit(0); } else { console.log('Landing, Control-C again to force exit'); exiting = true; mission.control().disable(); mission.client().land(function() { process.exit(0); }); } }); !

Slide 76

Slide 76 text

NoDebots.io

Slide 77

Slide 77 text

robotsconf.com

Slide 78

Slide 78 text

No animals were harmed in the making of this presentation Thanks!

Slide 79

Slide 79 text

github.com/andrew Thanks!

Slide 80

Slide 80 text

Thanks! @teabass