How to build Open Hardware self-navigating car robot

Post on 09-Jan-2017

331 views 3 download

Transcript of How to build Open Hardware self-navigating car robot

How to build Open Hardware Robotwith Arduino, RaspberryPi and Hot Glue

Tomáš Jukin@Inza

Tomáš Jukin@Inza

www.juicymo.cz@JuicymoCZ

#Probee

True evolution…

True evolution…GDG ohwHack 2014 mDevCamp 2016

True evolution…GDG ohwHack 2014 mDevCamp 2016

Robotics 101

Robotics 101

Micro-Computervs.

Micro-Controller

Robotics 101

Micro-Computervs.

Micro-Controller

Robotics 101

Micro-Computervs.

Micro-Controller

Robotics 101

Micro-Computervs.

Micro-Controller

Voltage: 3.3V Flash: SD card RAM: 512 MB (CPU & GPU) CPU: ARM11 (BCM2835 SoC) Clock: 700 MHzGPIO: 40 pin HDMI, Ethernet

RaspberryPi 1 B+

Arduino UNO

Voltage: 5V Flash: 32KB (-0.5 bootloader) SRAM: 2KB EEPROM: 1KB Clock: 16 MHzDigital I/O: 14/6 PWM Analog In: 6

Robotics 101ways of communication

Robotics 101IIC (i2c, I2C, I2C)Inter-Inter Circuit, 2 wires, <128 devices, <2m

ways of communication

Robotics 101IIC (i2c, I2C, I2C)Inter-Inter Circuit, 2 wires, <128 devices, <2m

ways of communication

Serial Peripheral Interface, N+3 wires, N devicesSPI

Robotics 101IIC (i2c, I2C, I2C)Inter-Inter Circuit, 2 wires, <128 devices, <2m

ways of communication

Serial Peripheral Interface, N+3 wires, N devices

Universal Asynchronous Receiver/Transmitter, 2 wires, 2 devices, <20m

SPI

UART

Robotics 101IIC (i2c, I2C, I2C)Inter-Inter Circuit, 2 wires, <128 devices, <2m

ways of communication

Serial Peripheral Interface, N+3 wires, N devices

Universal Asynchronous Receiver/Transmitter, 2 wires, 2 devices, <20m

Full Serial Line, 9 wires, 2 devices, <20mRS-232 (COM port)

SPI

UART

Robotics 101IIC (i2c, I2C, I2C)Inter-Inter Circuit, 2 wires, <128 devices, <2m

ways of communication

Serial Peripheral Interface, N+3 wires, N devices

Universal Asynchronous Receiver/Transmitter, 2 wires, 2 devices, <20m

Full Serial Line, 9 wires, 2 devices, <20mRS-232 (COM port)

Industry, 2 wires, <32 devices, <1200mRS-485 (EIA-485)

SPI

UART

Robotics 101IIC (i2c, I2C, I2C)Inter-Inter Circuit, 2 wires, <128 devices, <2m

ways of communication

Serial Peripheral Interface, N+3 wires, N devicesSPI

UART

Industry, 2 wires, <32 devices, <1200mRS-485 (EIA-485)

Universal Asynchronous Receiver/Transmitter, 2 wires, 2 devices, <20m

Full Serial Line, 9 wires, 2 devices, <20mRS-232 (COM port)

What does a4 wheels self driving car robotconsist of?

1x RaspberryPi 1 B+ Starter Set https://goo.gl/jaTY70

1x Chinese 4WD Car Kit with Funduino UNO http://goo.gl/qetuW5

5x Ultrasonic Sensor HC-SR04 http://goo.gl/YojTTp

1x Wi-Fi dongle D-Link DWA-127 https://goo.gl/9d9BPo

1x Arduino Micro https://goo.gl/yjVqgC

1x I2C Level Converter http://goo.gl/9i4jCK

1x RTC module DS1307 http://goo.gl/esKm7t

1x PIR sensor HC-SR501 http://goo.gl/LyYGmb

1x 4D Touch TFT Display 4DPi-35 Rev. 1 http://goo.gl/RWs7rI

1x Skewers

1x Hot Glue

*plus PiCamera and PowerBank to power Pi… (and cables)

http://goo.gl/tnXteh

The Idea

I2C

I2C

PWM

I2C

PWM12V

I2CUSB

PWM12V

I2C

SPI

USB

PWM12V

I2C

SPI

USB

PWM

PWM12V

I2C

SPI

USB

PWM

PWM12V

I2C

SPI

USB

PWM

PWM12V

I2C

SPI

USB

I2C PWM

PWM12V

I2C

SPI

USB

I2C PWM

PWM12V

I2C

SPI

USB

I2C PWM

PWM12V

I2C

SPI

USB

I2C PWM

PWM12V

I2C

PWM

I2C

5V USB 7V

5V3.3V

The Heart

The Heart

The Heart

Hardware

The Heart

Hardware

HAL

The Heart

Hardware

HAL

Events

The Heart

Hardware

HAL

Events

Pre-Emptive Multi-Tasking

The Heart

Hardware

HAL

Events

Pre-Emptive Multi-Tasking Config

How do we develop in Arduino?

Wiring / Processing

C / C++

C / C++

C / C++

5 Circles of Hell

5 Circles of Hellin Arduino

5 Circles of Hellin Arduino

.ino includes

5 Circles of Hellin Arduino

.ino includesLCD_i2c.h

5 Circles of Hellin Arduino

.ino includesLCD_i2c.hCrappy China goods

5 Circles of Hellin Arduino

.ino includesLCD_i2c.hCrappy China goodsHW bugs

5 Circles of Hellin Arduino

.ino includesLCD_i2c.hCrappy China goodsHW bugsThe need of switch

The Heart

v0 - Procedural (by MacGyver on ohwHack)

The Heart

v0 - Procedural (by MacGyver on ohwHack)

The Heartv0.5 - “Spagetka” (was to ugly to Git -> lost :-(…)

v0 - Procedural (by MacGyver on ohwHack)

The Heartv0.5 - “Spagetka” (was to ugly to Git -> lost :-(…)v1 - “Spagetti MAS” (in Git repo)

v0 - Procedural (by MacGyver on ohwHack)

The Heartv0.5 - “Spagetka” (was to ugly to Git -> lost :-(…)v1 - “Spagetti MAS” (in Git repo)v2 - “The Platform” (in Git repo, in progress)

v0 - Procedural (by MacGyver on ohwHack)

The Heartv0.5 - “Spagetka” (was to ugly to Git -> lost :-(…)v1 - “Spagetti MAS” (in Git repo)v2 - “The Platform” (in Git repo, in progress)

https://github.com/Juicymo/probee

http://goo.gl/lZuAzn

https://goo.gl/OhNByp

I2C

https://goo.gl/QzYRjs

https://goo.gl/lG0ggl

I2C

The Brain

The Brain

How do we develop for RaspberryPi?

In Ruby

But not only. It is a full featured* Linux.

But not only. It is a full featured* Linux.

*running on ARM… :-(

5 Circles of Hell

5 Circles of Hellin RaspberryPi

5 Circles of Hellin RaspberryPi

USB driven computer

5 Circles of Hellin RaspberryPi

USB driven computerUnstable

5 Circles of Hellin RaspberryPi

USB driven computerUnstableMore features madness

5 Circles of Hellin RaspberryPi

USB driven computerUnstableMore features madnessWi-Fi dongle

5 Circles of Hellin RaspberryPi

USB driven computerUnstableMore features madness

Unstable!!!Wi-Fi dongle

Multi-Agent System

The Brainbuild on aActor-based concurrentobject framework in Ruby

https://github.com/Juicymo/probee

The Brain

Raspbian

The Brain

Raspbian

rvm

The Brain

Raspbian

rvm

ruby

The Brain

Raspbian

rvm

ruby

celluloid

The Brain

Raspbian

rvm

ruby

celluloid

agens

The Brain

Raspbian

rvm

ruby

celluloid

agens

probee MAS

The Brain

Raspbian

rvm

ruby

celluloid

agens

probee MAS

https://github.com/Juicymo/probee

https://rubygems.org/gems/agens

https://github.com/celluloid/celluloid

https://rvm.io

The Brain

ObjectRuby OOP

The Brain

Object

Cell

Ruby OOP

Celluloid

The Brain

Object

Cell

Actor

Ruby OOP

Celluloid

Celluloid

The Brain

Object

Cell

Actor

Agent

Ruby OOP

Celluloid

Celluloid

agens

The Brain

Object

Cell

Actor

Agent

MovementAgent

Ruby OOP

Celluloid

Celluloid

agens

probee

The Brain

MovementAgent

Probee MAS

The Brain

Motors

MovementAgent

Probee MAS

The Brain

Motors

SteeringAgent

MovementAgent

Probee MAS

The Brain

Motors

SensorsSteeringAgent

MovementAgent

Probee MAS

The Brain

Motors

Sensors

CollisionAgent

SteeringAgent

MovementAgent

Probee MAS

The Brain

Motors

Sensors

CollisionAgent

SteeringAgent

MovementAgent

Probee MAS

The Brain

Motors

Sensors

CollisionAgent

SteeringAgent

MovementAgent

Probee MAS

Simple Agents can perform complex tasks

The Brain

The Brain

How to make AI LogicScripting

HFSM HeuristicsMAS GA ANN

HTN

How to make AI LogicScripting

HFSM HeuristicsMAS GA ANN

HTN

?

HFSM

Movement FSMStop Drive Slowly Drive Fast

HFSM

Movement FSMStop Drive Slowly Drive Fast

Turn Turret FSMStop Scan Target

HFSM

Movement FSMStop Drive Slowly Drive Fast

Turn Turret FSMStop Scan Target

How to combine them??

HFSM

Movement FSMStop Drive Slowly Drive Fast

Turn Turret FSMStop Scan Target

How to combine them??Modularity sucks too…

How to make AI LogicScripting

HFSM HeuristicsMAS GA ANN

HTN

?

How to make AI LogicScripting

HFSM HeuristicsMAS GA ANN

HTN

Behavior Trees

Behavior Trees

http://aigamedev.com/open/article/bt-overview/

http://behavior3js.guineashots.com/

http://aigamedev.com/open/article/behavior-trees-part1/

Neural Nets

HFSM

MAS

HTN

Behavior Trees

https://github.com/Inza/agenshttps://en.wikipedia.org/wiki/Multi-agent_system

https://github.com/aasm/aasmhttps://en.wikipedia.org/wiki/Finite-state_machine

https://github.com/Maumagnaguagno/HyperTensioNhttps://en.wikipedia.org/wiki/Hierarchical_task_network

https://github.com/jvoegele/behavior_treehttps://en.wikipedia.org/wiki/Behavior_tree

https://github.com/SergioFierens/ai4rhttps://en.wikipedia.org/wiki/Artificial_neural_network

Questions?

Tomáš Jukin@Inza

www.juicymo.cz@JuicymoCZ