Browse Source

new body

master
Yorick van Pelt 5 years ago
parent
commit
90edd80af9
  1. 65
      bodies/robotbody_noright.svg
  2. 3
      lemming_sim_student.js
  3. 14
      robotbody.svg

65
bodies/robotbody_noright.svg

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Licensed as CC0 Public Domain Dedication, see https://creativecommons.org/publicdomain/zero/1.0/. -->
<svg
xmlns:ns="http://creativecommons.org/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
x="0px"
y="0px"
width="239.8282"
height="186.78011"
viewBox="0 0 239.8282 186.78011"
xml:space="preserve"
id="svg11"
sodipodi:docname="robotbody_noright.svg"
inkscape:version="0.92.2 (unknown)"><metadata
id="metadata17"><rdf:RDF><ns:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></ns:Work><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs15" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1016"
id="namedview13"
showgrid="false"
inkscape:zoom="1.5742187"
inkscape:cx="193.78259"
inkscape:cy="72.49728"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg11"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-center="true"
inkscape:snap-page="true"
inkscape:snap-global="false"><sodipodi:guide
position="87.480965,95.186771"
orientation="1,0"
id="guide863"
inkscape:locked="false" /><sodipodi:guide
position="87.480965,95.186771"
orientation="0,1"
id="guide867"
inkscape:locked="false" /></sodipodi:namedview><path
id="robotbody"
d="m 21.840805,32.282261 c -29.4070742,38.075324 -29.2031002,89.304329 1.126302,124.879399 28.308167,33.20432 96.216923,41.60047 129.034143,9.08347 18.43503,-12.80861 9.62964,-4.23612 16.52932,-15.43367 4.97497,-8.07393 7.20296,-16.17729 7.39509,-18.53562 2.47109,-30.33143 1.21949,-67.484605 -2.03551,-83.758545 -0.8545,-4.27227 74.1647,3.74803 65.19284,-6.66691 C 229.23764,30.421398 158.23428,27.099346 155.90436,24.175764 133.57052,-3.8490539 58.313014,-14.940787 21.840805,32.282261 Z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sscssssss"
style="stroke-width:0.99999988" /></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

3
lemming_sim_student.js

@ -23,7 +23,7 @@ var simInfo = {
airDrag: 0.1, // "air" friction of enviroment; 0 is vacuum, 0.9 is molasses
boxFric: 0.005, // friction between boxes during collisions
boxMass: 0.01, // mass of boxes
boxSize: 15, // size of the boxes, in pixels
boxSize: 10, // size of the boxes, in pixels
robotSize: 13, // approximate robot radius, in pixels (note the SVG gets scaled down)
robotMass: 0.4, // robot mass (a.u)
gravity: 0, // constant acceleration in Y-direction
@ -96,7 +96,6 @@ class Lemming extends Robot {
}
move() {
//if (sim.curSteps % 250 == 0) this.turnDeg(-90)
//return
// TODO: Define Lemming program here.
const vals = ['distL', 'distR', 'carry', 'wallL', 'wallR']
.reduce(((p,c) => ((p[c] = this.getSensorValById(c)), p)), {})

14
robotbody.svg

@ -13,18 +13,18 @@
version="1.1"
x="0px"
y="0px"
width="239.19885"
width="239.8282"
height="186.78011"
viewBox="0 0 239.19885 186.78011"
viewBox="0 0 239.8282 186.78011"
xml:space="preserve"
id="svg11"
sodipodi:docname="robotbody_longleft_mediumright.svg"
sodipodi:docname="robotbody_noright.svg"
inkscape:version="0.92.2 (unknown)"><metadata
id="metadata17"><rdf:RDF><ns:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></ns:Work><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs15" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
@ -50,16 +50,16 @@
inkscape:snap-center="true"
inkscape:snap-page="true"
inkscape:snap-global="false"><sodipodi:guide
position="87.480964,95.18677"
position="87.480965,95.186771"
orientation="1,0"
id="guide863"
inkscape:locked="false" /><sodipodi:guide
position="87.480964,95.18677"
position="87.480965,95.186771"
orientation="0,1"
id="guide867"
inkscape:locked="false" /></sodipodi:namedview><path
id="robotbody"
d="m 21.840805,32.282261 c -29.4070742,38.075324 -29.2031002,89.304329 1.126302,124.879399 28.308167,33.20432 96.216923,41.60047 129.034143,9.08347 20.97597,3.07228 40.7562,3.38671 47.02064,-6.54037 5.06112,-8.02021 -23.28836,-25.07059 -23.09623,-27.42892 2.47109,-30.33143 1.21949,-67.484605 -2.03551,-83.758545 -0.8545,-4.27227 73.52946,-1.96909 64.5576,-12.384033 C 228.6024,24.704276 158.23428,27.099346 155.90436,24.175764 133.57052,-3.8490539 58.313014,-14.940787 21.840805,32.282261 Z"
d="m 21.840805,32.282261 c -29.4070742,38.075324 -29.2031002,89.304329 1.126302,124.879399 28.308167,33.20432 96.216923,41.60047 129.034143,9.08347 18.43503,-12.80861 9.62964,-4.23612 16.52932,-15.43367 4.97497,-8.07393 7.20296,-16.17729 7.39509,-18.53562 2.47109,-30.33143 1.21949,-67.484605 -2.03551,-83.758545 -0.8545,-4.27227 74.1647,3.74803 65.19284,-6.66691 C 229.23764,30.421398 158.23428,27.099346 155.90436,24.175764 133.57052,-3.8490539 58.313014,-14.940787 21.840805,32.282261 Z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sscssssss"
style="stroke-width:0.99999988" /></svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Loading…
Cancel
Save