GithubHelp home page GithubHelp logo

scratch-dexter's Introduction

scratch-dexter

A Scratch extension to interact with Dexter.

Loading

  1. Install Node.JS: https://nodejs.org/en/download/
  2. Make a folder, change into it, run npm init and npm install ws, and download the proxy file.
    mkdir DexProxy
    cd DexProxy
    npm init
    npm install ws
    wget https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/httpd.js
  3. Run the proxy server: node httpd.js <Dexter IP> where <Dexter IP> is the IP of the robot.
  4. Navigate to https://scratchx.org?url=https://kenny2github.github.io/scratch-dexter/ext.js#scratch
    • On Chrome, click to enable Flash
  5. Accept the warning about experimental extensions.

Using

As an example:

script

This will make the robot wave back and forth.

scratch-dexter's People

Contributors

jamesnewton avatar kenny2github avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scratch-dexter's Issues

Command oplets to implement for release

Command oplets to implement:

  • P"pid_move_all_joints"PID_FINEMOVEChases a goal position on each joint using the PID control system which must be enabled. Requires calibration. The goal can change in the middle of the move. Movement is not coordinated so each joint may arrive at the goal at a different time. The standard trapezoidal speed ramping is not used. See "a".

    Note: Encoder calibration is not yet a thing, and is likely to be too complicated for majority Scratch users. This block is therefore implemented but useless ._.
  • g"get_robot_status"SEND_HEARTBEATReturns the current status of the robot.

    Note: Scratch has nowhere near sophisticated enough data structures to understand the data returned by this. Probably forgo this altogether or only add it as an "update status" command; actual data parts will be returned by reporter(s):
    • ([joint 1 v] [sin v]) where "joint 1" can be 1-5 and "sin" can be "position at", "position delta" etc.
    • (last [instruction number v]) where "instruction number" can be "job number", "start time", "end time", "command" etc.

Create Scratch 3 version

It appears the newest version of Scratch doesn't support extensions via the mit web site. However, looking at the source for the Scratch 3 GUI at:
https://github.com/LLK/scratch-gui

I see there is an examples / extension folder. I think it would be worth hosting Scratch on Dexter, with the extensions pre-installed to work with it. Is that a project that interests you?

Loading scratch extensions from github repo

It would be nice to go to
http://scratchx.org
click "more blocks" then "Load experimental extension" and be able to load the extension from this URL:
https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/ext.js
or to do that in one step with
http://scratchx.org?url=https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/ext.js
but when you try that, nothing happens. If you start the Chrome debug tools (menu, more tools, developer tools) you see an error message:
Refused to execute script from 'https://raw.githubusercontent.com/Kenny2github/scratch-dexter/master/ext.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

See also:

Suggestion: Follow the directions in the link above to make it very easy for users to load scratchx with the url to the extension and talk to their dexter.

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.