Skip to content
JamesNewton edited this page Sep 11, 2018 · 27 revisions

DDE allows users to develop and run software on multiple platforms to control the Dexter 5 axis robot arm. It is fundamentally a JavaScript development environment with lots of extensions. See DexRun-DDE-communications for more detail about the communications between DDE and Dexter.

Units: Note that Dexter uses the metric system of measurement. So all units of distance are in meters. A meter is about 3 feet which is about Dexters full reach at the size Dexter has been made at so far. A tenth of a meter (e.g. 0.1) is about 4 inches which is about the length of your finger. A hundredth of a meter (e.g. 0.01) called a "centimeter" is a about a half inch (actually closer to 0.4 inches) or about the width of your little finger. And a thousandth of a meter (e.g. 0.001) called a "millimeter" is tiny, about a half of a tenth of an inch or about the thickness of a fingernail.

Programming notes:

Debugging: Note that all of this is documented in the help system inside DDE. Download and install the program to access that in it's formatted form.

  • the out function can be wrapped around anything to dump a copy of the result to the output panel when it is evaluated without any change in program behavior. It returns whatever it prints, so there is no side effect to it being included. E.g. let variable = out("Hello" + "World").toUpper()) will still put "HELLOWORLD" in variable, but it will also let you see "HelloWorld" on the screen.
  • inspect provides a very nice interactive inspector in the output panel. It does not return values like out as of this time.
  • To debug DDE code in the Chrome debugger, launch that by right clicking anywhere in the Editor pane and select Inspect Element to open the debugger UI. Then add debugger; anywhere in the code and "Eval" it. You can explore variables, step, etc... everything you can do in a web page.
  • To update / debug any part of DDE, simply overwrite the objects property in the Editor script. To retain that between restarts, add the code to the dde_init.js file in the dde_apps folder. e.g. To get a report to the output panel of the result of any call to Dexter.sleep in the job, just redefine the original function:
    Dexter.sleep = function(seconds){ return make_ins("z", seconds) }
    as a new function including a call to out. e.g.
    Dexter.sleep = function(seconds){ return out(make_ins("z", seconds)) }
    any job evaluated after that line will show the instruction array generated by a Dexter.sleep in the do_list.

    In general, you can override any function in a class with:
    Class.function-name = function(parameters) { code }

Clone this wiki locally