Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You can do what with math now?

You can do what with math now?

Opening Keynote at Web Directions Code 2014 in Melbourne, Australia.

Demo code at https://github.com/rockbot/wdc14 and https://github.com/rockbot/manny.

Video for slide 63 can be seen at http://youtu.be/2oNqa-cL_ZQ

Raquel Vélez

May 01, 2014
Tweet

More Decks by Raquel Vélez

Other Decks in Technology

Transcript

  1. Theory (x1 , y1 ) x1 , x2 , x3

    y1 (x2 , y2 ) (x3 , y3 ) y2 y3
  2. Rotation of joint: cos( -sin( 0 sin( cos( 0 0

    0 1 Rz = Location of point: x y 0 P = Theory
  3. cos( -sin( 0 F sin( cos( 0 F 0 0

    1 0 0 0 0 1 Theory FromHTo = Rz (θ) P
  4. cos( -sin( 0 L sin( cos( 0 0 0 0

    1 0 0 0 0 1 Theory 1H2 =
  5. cos( -sin( 0 L sin( cos( 0 0 0 0

    1 0 0 0 0 1 Theory 2HEE =
  6. # # 0 G # # 0 G 0 0

    1 0 0 0 0 1 Theory GH ΕΕ =
  7. // other useful(?) api calls ctx.save(); // save the position/orientation

    ctx.restore(); // revert to saved position/orientation ! ctx.clearRect(0, 0, 500, 300); // clear the board! ! ctx.rotate(rad); ctx.translate(x, y); Canvas
  8. // other useful(?) api calls ctx.save(); // save the position/orientation

    ctx.restore(); // revert to saved position/orientation ! ctx.clearRect(0, 0, 500, 300); // clear the board! ! ctx.rotate(rad); ctx.translate(x, y); Canvas Can we avoid the math and just use these?
  9. var vektor = require('vektor'), p = vektor.vector, r = vektor.rotate,

    h = vektor.homog; ! var LINK_LENGTHS = [100, 100], ORIGIN = new p([250, 50, 0]); Vektor
  10. var H = h( r.RotX(0), ORIGIN ), H1 = H.dot(

    h( r.RotZ(angles[0]), 0 ) ), H2 = H1.dot( h( r.RotZ(angles[1]), new p([LINK_LENGTHS[0],0,0]) ) ), H3 = H2.dot( h( 0, new p([LINK_LENGTHS[1],0,0]) ) ); ! var joints = [H1.getPoint(), H2.getPoint(), H3.getPoint()]; Vektor
  11. f(θ1 ,θ2 ) = P = Joint Angles Position of

    End Effector x y 0 Forward Kinematics
  12. g(xEE , yEE ) = [θ1 , θ2 ] Joint

    Angles Position of End Effector Inverse Kinematics
  13. Qty Item Cost 1 Arduino UNO + breadboard $25 2

    Standard Servos $30 2 Sticks $2 1 Platform $5 Wires, tape, glue, swag $5 Total $67 Manny’s Hardware
  14. var servo = five.Servo({ pin: 9, range: [10, 170] });

    ! servo.to(angle); Manny’s Software