Skip to content
/ BBB-Bot Public
forked from tdack/BBB-Bot

Client and Server code to control a simple two motor robot using a BeagleBone Black

License

Notifications You must be signed in to change notification settings

pierzy/BBB-Bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beaglebone-robot

A simple browser client that is able to send commands over web sockets to a BeagleBone Black running the server code.

Client

Client

Bootstrap/JQuery based web page that will connect to the server and send simple commands over web sockets to control the robot.

Server

Control code written in Python.

Requires:

  1. Adafruit_BBIO Python library (installed by default on newer BeagleBone Black images)
  2. Python json library (also installed by default)

Robot

Simple two-wheel (differential drive) robot. Motors are connected to a Sabertooth 2x12 motor controller allowing simple control and easy separation of voltages.

Control messages are sent to the controller using "packetised serial mode".

Client-Server Communication

Control messages are passed from client to server as JSON over a web sockets transport. Messages used are:

Client -=> Server JSON messages

  • speed is in percent and should be sent with every command.
  • Stop command will ignore speed, and stop robot.
  • Speed command when stopped will not start movement.
    { event: 'drive',
        cmd: {
                direction: 'fwd|rev|left|right|stop|speed',
                speed: '0-100'
            }
    }

Server -=> Client JSON messages

Sent in response to each command sent from the client

    { event: 'ack',
        cmd: {
                cmd: 'command and speed executed by server'
            }
    }

Sent when an obstacle is detected on one of the configured sensors. Robot will take "evasive" action when an obstacle is detected. Robot will reverse at 150% of set speed for a short period that is proportional to speed and then stop.

    { event: 'obstacle',
       data: {
                sensor: 'sensor designation that obstacle was detected on',
                name: 'descriptive name of sensor (eg: left, right)'
            }
    }

Client can act on obstacle message to take further action.

About

Client and Server code to control a simple two motor robot using a BeagleBone Black

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.3%
  • JavaScript 14.4%
  • HTML 4.4%
  • CSS 0.9%