Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
cfry committed Jul 8, 2017
1 parent 5e071ac commit a3bbe9c
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 33 deletions.
1 change: 1 addition & 0 deletions doc/browser_vs_dde.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<style> .doc_details { margin-left:20px; font-size:16px; } .doc_details summary { font-weight: 600; }</style><div style='font-size:16px;'><h2>Browser vs. DDE</h2><i>Fry July 7, 2017</i><p/>A good way to understand DDE at a high level is to compare it to a web browser.A browser is an application that displays content from the web or files on your computer.The content can be dynamically generated based on user actions and underlying code thatcomputes the content to be displayed. The browser provides the runtime engine for running that code. Major browsers also have tools for helping you debug that code, though these are hidden from most users.<p/><b>The Browser Mindset</b><br/>In the browser mindset, most users are “content viewers”.They are distinct from “content creators”. The idea is that most people want to read, but not write.In the broad world, this is roughly true, though most people do at least a little writingfrom time to time. None-the-less, while most Internet users know how to view content on the web, they do not know how to author content. And most people that can author content, only know how to write static text, not more complex, definitive data formats or programs that can compute and generate content.<p/>Because of the separation of readers from writers, different tools serve thesedifferent classes of users. This makes sense. The readers don’t want their worldcluttered with tools they don’t need to use. But if a reader wants to become a writer,the separation of tools makes it harder to transition from reader to writer.You have to learn a new toolset.<p/>There is literally a plethora (in the worst sense of the word) of tools to choose fromand learn how to use, to author web content. Typically they interact poorly with eachother as they were designed and implemented by separate teams that were only attemptingto solve part of the problems that writers face.<p/><b>The DDE Mindset</b><br/>DDE maintains the opposite mindset. There is no difference between readers and writers.Every content viewer should (and will need to at some point) become a content creator.DDE strives to make that transition as smooth as possible.<p/>You can think ofDDE more like Microsoft Word than a browser. Yes you can read documents in it.Yes you can even print documents using it. But the bulk of its functionality is to helpusers author those documents.<p/>Microsoft Word is for viewing, writing and printing text & graphic documents.DDE is for viewing, writing and “printing” 3D objects. Rather than control adesktop inkjet 2D printer as MS Word does, DDE controls Dexter, a 5 axis robot armthat is far more versatile than an inkjet printer because it can use many differentprocesses for making things.<p/><b>Multi-Process Making</b><br/>Conventional 3D printers use just one process, Fused Deposition Modeling (FDM)for printing files in a ridged file format called “STL” that describes3D dimensional surfaces using a set of many triangles. STL is transformed into layersby an application called a “slicer”, and the printer prints each layer, one on top of another.<p/>Dexter is fundamentally a motion platform that can, under program control,pick up different tools (called “end effectors” in robotics) that perform different functionsat the location that the motion platform moves them to.These end effectors can perform FDM, cutting with a laser, move parts(pick and place) and a wide variety of other tasks. In fact, Dexter is designed toaccommodate end effectors we haven’t even thought of yet.<p/>Who will? Dexter’s users. Through open source sharing, we promote the developmentof end effectors. To control these end effectors that will do a myriad of tasks,new processes need to be developed. Larger processes will be composed of differentkinds of smaller, narrower processes. Viewing, authoring, and operating theseprocesses is what DDE is for.<p/><b>Browser Comparison Revisited</b><br/>Despite all these differences with browsers, DDE does share a lot with them.First, it manipulates the same information formats, HTML, CSS and JavaScriptthat comprise web pages. Second it uses the underlying Chrome browser rendering,and JavaScript runtime engines. You can even take advantage of Chrome’s debugging tools within DDE.<p/>But DDE extends the browser by allowing programmatic access to the file system of yourlocal computer (a security restriction of browsers). It has access to other underlyingcapabilities of a computer’s operating system (WindowsOS, MacOS and Linux) alsorestricted due to security concerns in browsers. Additionally, DDE provides high level extensionsto JavaScript to help users author and run processes on Dexter.(These are called <i>Jobs</i>). DDE includes programmatic low level access to Dexter itself.Finally, DDE contains an extensive help system to make it easy for users to become,not just content viewers, but content creators.</div>
Expand Down
6 changes: 5 additions & 1 deletion doc/doc_for_website.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.doc_top_level_summary {
font-size:18px;
font-weight:400;
width:385px;
width:520px;
padding-left:15px;
background-color: #b8bbff;
}
Expand All @@ -16,6 +16,10 @@
<iframe width=600 height=200 class="doc_iframe" allowtransparency="true"
src="https://rawgit.com/cfry/dde/master/doc/dde_overview/Dexter_Development_Environment.html">
</iframe>
<br/><div class="doc_top_level_summary">Browser vs. DDE</div>
<iframe width=600 height=200 class="doc_iframe"
src="https://rawgit.com/cfry/dde/master/doc/browser_vs_dde.html">
</iframe>
<br/><div class="doc_top_level_summary">Dexter Kinematics</div>
<iframe width=600 height=200 class="doc_iframe"
src="https://rawgit.com/cfry/dde/master/doc/dexter_kinematics.html">
Expand Down
4 changes: 2 additions & 2 deletions doc/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</style>
<details class="doc_details"><summary>About</summary>
This is <a href="http://hdrobotic.com/" target="_blank">Dexter</a> Development Environment<br/>
version: <span id="dde_version_id">2.0.3</span><br/>
released: <span id="dde_release_date_id">Jul 7, 2017</span>
version: <span id="dde_version_id">2.0.4</span><br/>
released: <span id="dde_release_date_id">Jul 8, 2017</span>
<p/>
DDE helps you create, debug, and send software to a Dexter robot.
You can use any JavaScript augmented with DDE-specific functions to help find out about,
Expand Down
50 changes: 45 additions & 5 deletions doc/ref_man.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
Example:<pre><code>
var args = {x: 12.3 * 10}
args.y = 40 + 5
make_url("www.ibm.com", args)</code> => "http://www.ibm.com?x=123&y=45"</pre>
make_url("www.ibm.com", args)</code> => <samp>"http://www.ibm.com?x=123&y=45"</samp></pre>
</details>

<details class="doc_details"><summary>Sound</summary>
Expand Down Expand Up @@ -324,6 +324,9 @@
</code></pre>
<p/>
load_files returns the result of evaluating the last expression in the last file loaded.
<p/>
It is conventional to use a file extension of ".js" for files containing JavaScript,
but not strictly necessary.
</details> <!-- end load_files -->

<details id="write_file_doc_id" style="margin-left:40px;"><summary>write_file</summary>
Expand Down Expand Up @@ -387,7 +390,7 @@
persistent_get returns the value of the variable in the argument.<br/>
<b>Example:</b> <br/>
<code>persistent_set("test4", 44)</code><br/>
<code>persistent_get("test4")</code> => 44<br/>
<code>persistent_get("test4")</code> => <samp>44</samp><br/>
</details> <!-- end persistent_get -->

<details id="persistent_initialize_doc_id" style="margin-left:40px;"><summary>persistent_initialize</summary>
Expand Down Expand Up @@ -1469,7 +1472,7 @@
</details>

<details id="Dexter.move_to_doc_id" class="doc_details"><summary>move_to</summary>
This instruction commands Dexter to move from whereever it is, to position its
This instruction commands Dexter to move from where ever it is, to position its
end effector at the given x, y, z location. It is complicated by the fact that
usually there is more than one configuration of Dexter's joints that
can achieve that position and that Dexter is inherently limited by the
Expand Down Expand Up @@ -1577,15 +1580,52 @@

</details>

<details id="Dexter.move_to_straight_doc_id" class="doc_details"><summary>move_to</summary>
<code>Dexter.move_to_straight</code> is quite similar to <code>Dexter.move_to</code>.
It takes the same first three arguments as move_to and moves Dexter to
the same spot. The difference is the path that Dexter's end effector takes
to getting to the destination. move_to's path is the path that results
from moving all the joints such that they all start moving at the same
time and stop moving at the same time, but each joint may move at
a different speed than the others. In move_to_straignt,
the path approximates a straight line.
<p/>
Dexter achieves this by breaking up the distance between the start
and end xyz locations into many short straight-line segments where
the start and end location of each of these segments is on
a straight line between the starting and ending locations.
<p/>
<i>Parameters:</i><br/>
<b>xyz</b> An array of 3 numbers indicating the x, y, and z location to
move to. Same as move_to.<br/>
<b>J5_direction</b> The ending direction that LINK5 will be pointing when
the move is complete. Same as move_to.<br/>
<b>config</b> The configuration of the joints at the end of the move.
Same as move_to.<br/>
<b>tool_speed</b> The maximum speed that Dexter's end effector will move.
Default: 5 millimeters per second. Not in move_to.<br/>
<b>resolution</b> How short to make the straight lines that connect the
starting xyz to the ending xyz. Default: 0.5 millimeters.
<p/>
Example:<br/>
<pre><code> new Job({name: "my_job",
do_list: [Dexter.move_to([0, 0.55, 0.075]),
Dexter.move_to_straight([0, 0.5, 0.075])]
})</code></pre>
Moves Dexter's end effector from location: [0, 0.55, 0.075] to
location [0, 0.5, 0.075] in a straight line.
</details>

<details id="make_ins_doc_id" class="doc_details"><summary>make_ins</summary>
Normally you should make instructions for Dexter using one of the high level method calls,
ie <code>Dexter.move_all_joints</code>. However, we provide the function <code>make_ins</code>,
useful in some low level situations. The first argument is the instruction type, (nickname: "oplet")
a single letter string such as "a". The remaining arguments are whatever that instruction type
accepts. Example:<br/>
<code>make_ins("a", 1, 2, 3, 4 ,5)</code> creates an instruction that moves the 5 joints
by 1, through 5 respectively.
<code>make_ins("a", 1, 2, 3, 4 ,5)</code> =>
<samp>[undefined, undefined, undefined, undefined, "a", 1, 2, 3, 4, 5]</samp>
creates an instruction that moves the 5 joints
by 1, through 5 degrees respectively.
If you have the arguments in an array, you can use this syntax:<br/>
<code> make_ins("a", ...my_array)</code>
<p/>
Expand Down
24 changes: 24 additions & 0 deletions doc/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
.doc_details summary { font-weight: 600; }
</style>

<details class="doc_details"><summary>v 2.0.4, Jul 8, 2017</summary>
Highlights: load_files can now load file of any extensions.<br/>
New Article: Browser vs. DDE.<br/>
New instruction: Dexter.move_to_straight.<br/>
<ul>
<li>load_files can now load files with any extension or no extension,
not simply ".js" files.</li>

<li> Ref Man make_url & persistent_get examples improved for test suite.</li>

<li> make_ins now warns if passed an invalid instruction_type.</li>

<li> Click help now correctly identifies floating point numbers
as well as integers.</li>

<li> New article: Browser vs. DDE now in doc pane.</li>

<li> Doc pane re-org: now all 4 articles under one twist-down: "Articles".</li>

<li>New instruction: Dexter.move_to_straight
in Instruction series, click help and Ref Man.</li>
</ul>
</details>

<details class="doc_details"><summary>v 2.0.3, Jul 7, 2017</summary>
Highlights: run_instruction dialog extensions, Ref Man Examples are now tests.
bug fixes.
Expand Down
14 changes: 9 additions & 5 deletions instruction.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ Instruction.args = function(ins_array){

//user might call this at top level in a do_list so make it's name short.
function make_ins(instruction_type, ...args){
let result = new Array(Instruction.INSTRUCTION_TYPE)
result.push(instruction_type)
if (args.length === 0) { return result } //avoids generating the garbage that concat with an arg of an empty list would for this common case, ie for "g" ahd "h" instructions
else { return result.concat(args) }
return result.concat(args)
if(!Dexter.instruction_type_to_function_name_map[instruction_type]){
warning("make_ins called with an invalid instruction_type: " + instruction_type +
"<br/>make_ins still returning an array using: " + instruction_type)
}
let result = new Array(Instruction.INSTRUCTION_TYPE)
result.push(instruction_type)
if (args.length === 0) { return result } //avoids generating the garbage that concat with an arg of an empty list would for this common case, ie for "g" ahd "h" instructions
else { return result.concat(args) }
return result.concat(args)
}


Expand Down
5 changes: 4 additions & 1 deletion js_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ Js_info = class Js_info {
])) {
return fn_name
}
else if(!Number.isNaN(parseFloat(fn_name))){ //could be an integer or a float. that's ok, return whole fn_name
return fn_name
}
else {
let path_elts = fn_name.split(".")
return last(path_elts)
Expand Down Expand Up @@ -379,7 +382,7 @@ Js_info = class Js_info {
let fn4 = value_of_path(fn_name)
return "function " + Js_info.wrap_fn_name(fn_name) + function_params(fn4)
case "series_oplet_id":
const oplet_full_name = "Dexter." + Dexter.instruction_type_to_function_name_map[fn_name]
const oplet_full_name = "Dexter." + Dexter.instruction_type_full_function_name(fn_name)
var full_name_tag = Js_info.wrap_fn_name(oplet_full_name)
return "<code style='color:blue;'>" + fn_name + "</code> means Dexter instruction: " + full_name_tag
case "series_robot_status_label_id":
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "dexter_dev_env",
"productName": "dexter_dev_env",
"version": "2.0.3",
"release_date": "Jul 7, 2017",
"version": "2.0.4",
"release_date": "Jul 8, 2017",
"description": "Dexter Development Environment",
"author": "Fry",
"license": "GPL-3.0",
Expand Down
23 changes: 14 additions & 9 deletions ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,20 @@

function init_doc(){
const path = __dirname + "/doc/guide.html"
let content = '<details><summary class="doc_top_level_summary">Overview</summary>\n' +
file_content(__dirname + "/doc/dde_overview/Dexter_Development_Environment.html") +
"</details>\n" +
'<details><summary class="doc_top_level_summary">Dexter Kinematics</summary>\n' +
file_content(__dirname + "/doc/dexter_kinematics.html") +
"</details>\n" +
'<details><summary class="doc_top_level_summary">Glossary</summary>\n' +
file_content(__dirname + "/doc/glossary.html") +
"</details>\n" +
let content = '<details><summary class="doc_top_level_summary">Articles</summary>\n' +
'<details class="doc_details"><summary class="doc_articles_level_summary">Overview</summary>\n' +
file_content(__dirname + "/doc/dde_overview/Dexter_Development_Environment.html") +
"</details>\n" +
'<details class="doc_details"><summary class="doc_articles_level_summary">Browser vs. DDE</summary>\n' +
file_content(__dirname + "/doc/browser_vs_dde.html") +
"</details>\n" +
'<details class="doc_details"><summary class="doc_articles_level_summary">Dexter Kinematics</summary>\n' +
file_content(__dirname + "/doc/dexter_kinematics.html") +
"</details>\n" +
'<details class="doc_details"><summary class="doc_articles_level_summary">Glossary</summary>\n' +
file_content(__dirname + "/doc/glossary.html") +
"</details>\n" +
'</details>\n' +
'<details><summary class="doc_top_level_summary">User Guide</summary>\n' +
file_content(__dirname + "/doc/guide.html") +
"</details>\n" +
Expand Down
20 changes: 15 additions & 5 deletions robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1169,11 +1169,19 @@ Dexter.move_to_straight = function(xyz = [],
resolution = 0.5*_mm){
return function(){
let [old_xyz, old_J5_direction, old_config] = Kin.J_angles_to_xyz(this.robot.angles, this.robot.pose)
return move_to_straight_aux(old_xyz, xyz,
J5_direction, config,
tool_speed,
resolution,
this.robot.pose)
try {
return move_to_straight_aux(old_xyz, xyz,
J5_direction, config,
tool_speed,
resolution,
this.robot.pose)
}
catch(err){
this.stop_for_reason("errored", "Dexter instruction move_to_straight passed xyz values:<br/>" + xyz +
"<br/>that are not valid for moving straight to. <br/>" +
err.message)

}
}
}

Expand Down Expand Up @@ -1344,6 +1352,7 @@ Dexter.set_open_loop = function(){ return setOpenLoop() }

//End Dexter Instructions
//____________Dexter Database______________
//Note: often you should use Robot.instruction_type_to_
Dexter.instruction_type_to_function_name_map = {
a:"move_all_joints",
b:"move_to", //fry
Expand Down Expand Up @@ -1372,6 +1381,7 @@ Dexter.instruction_type_to_function_name_map = {
x:"exit",
z:"sleep"
}

/*
Dexter.prototype.props = function(){
let file_name = "dde_" + this.name + "_props.json"
Expand Down
2 changes: 1 addition & 1 deletion series.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ Series.instances = [
"Dexter.get_robot_status", "Dexter.get_robot_status_immediately",
"Dexter.load_tables", "Dexter.move_all_joints", "Dexter.move_all_joints_relative",
"Dexter.move_home",
"Dexter.move_to", "Dexter.move_to_relative",
"Dexter.move_to", "Dexter.move_to_relative", "Dexter.move_to_straight",
"Dexter.run_gcode", "Dexter.record_movement", "Dexter.replay_movement",
"Dexter.set_follow_me", "Dexter.set_force_protect", "Dexter.set_keep_position", "Dexter.set_open_loop",
"Dexter.set_parameter", "Dexter.sleep", "Dexter.slow_move", "Dexter.write", "Dexter.write_to_robot",
Expand Down
4 changes: 3 additions & 1 deletion storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,12 @@ function load_files(...paths) {
else if (path.endsWith("/")) { //path does not start with slash.
prefix = path //assumes path is intended to be under dde_apps/
}
/*kent doesn't like restriction. Sending filesin email neednot tto have the .js extension
and some pure data files maybe shouldn't have .js extnsions.
else if (!path.endsWith(".js")){
dde_error("loading_file got path: " + path + ' which does not end in ".js"' +
"<br/>No files were loaded.")
}
}*/
else {
path = prefix + path
resolved_paths.push(path)
Expand Down
Loading

0 comments on commit a3bbe9c

Please sign in to comment.