Coder Social home page Coder Social logo

aimbotio's Introduction

AIM Robot IO

Installation

go get github.com/petchumpriwan/aimbotio

replace these files with new files from aimbotio/edited_files

github/meedee-rpi/graphql-server/src/server.js 
# Remove server namespace

github/meedee-rpi/python-server/server.py
# Remove server namespace and add function to convert string to dictionary

then run this command on terminal

cd github/meedee-rpi/graphql-server
npm run build
sudo npm run serve

cd github/meedee-rpi/python-server
python server.py

Motor

Motor on AIM Robot can be controlled by sending desired position to the Motor Server which run on Python via socket.io websocket communications protocol.

The position of motor represents the position of robot's head, arms and body.

Sample Code

package main

import (
	"time"

	"github.com/petchumpriwan/aimbotio"
)

func main() {
	myMotor := aimbotio.Motor()
	myMotor.Connect(7000)               // Connect to motor server on port 7000

	// Set Position of Head, Left Arm, Right Arm, Trunk respectively
	myMotor.Drive(100, -100, 100, 50)
	// Input can be vary from -100 to 100 which 0 means middle position

	time.Sleep(1500 * time.Millisecond) // Wait motor to move to desired position

	myMotor.Drive(-100, 100, -100, -50)
	time.Sleep(2000 * time.Millisecond)

	myMotor.Drive(0, 0, 0, 0)           // Move to default position

	myMotor.Disconnect()                // Disconnect from motor server

}

References

aimbotio's People

Contributors

petchumpriwan avatar

Stargazers

 avatar

Forkers

fardman69420

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.