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

583a0cfd3e0ec851166c5c6fa5e506a5?s=128

Raquel Vélez

May 01, 2014
Tweet

Transcript

  1. 15.

    Theory (x1 , y1 ) x1 , x2 , x3

    y1 (x2 , y2 ) (x3 , y3 ) y2 y3
  2. 25.

    Rotation of joint: cos( -sin( 0 sin( cos( 0 0

    0 1 Rz = Location of point: x y 0 P = Theory
  3. 26.

    cos( -sin( 0 F sin( cos( 0 F 0 0

    1 0 0 0 0 1 Theory FromHTo = Rz (θ) P
  4. 27.

    cos( -sin( 0 L sin( cos( 0 0 0 0

    1 0 0 0 0 1 Theory 1H2 =
  5. 28.

    cos( -sin( 0 L sin( cos( 0 0 0 0

    1 0 0 0 0 1 Theory 2HEE =
  6. 30.

    # # 0 G # # 0 G 0 0

    1 0 0 0 0 1 Theory GH ΕΕ =
  7. 32.
  8. 38.

    // 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
  9. 39.

    // 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?
  10. 42.
  11. 44.

    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
  12. 45.

    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
  13. 52.

    f(θ1 ,θ2 ) = P = Joint Angles Position of

    End Effector x y 0 Forward Kinematics
  14. 53.

    g(xEE , yEE ) = [θ1 , θ2 ] Joint

    Angles Position of End Effector Inverse Kinematics
  15. 59.

    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
  16. 61.

    var servo = five.Servo({ pin: 9, range: [10, 170] });

    ! servo.to(angle); Manny’s Software
  17. 63.
  18. 65.
  19. 66.