User:Jjewell6655/ENES-100/project 3

=Week 1 Narrative=
 * 0/0/0 .. nothing to grade --1sfoerster (discuss • contribs) 16:33, 21 April 2014 (UTC)

=Week 2 Narrative=
 * 0/0/0 .. nothing to grade --1sfoerster (discuss • contribs) 15:51, 22 April 2014 (UTC)

=Week 3 Narrative= This week I downloaded the Processing program in order to branch out to find a program that could better use the LeapMotion controller. I noticed the distinct similarity it had to the Arduino programming in both appearance and syntax language. After watching through the introductory video, I did a quick search online and downloaded a library for the LeapMotion software. The one thing I noticed instantly was that this community doesn't seem to be as user-friendly as the LabVIEW community is, in that they don't really explain anything. The "instructions" I found on how this library would work was just a long list of code without any detailing as to the purpose or reason for syntax. They didn't even explain how to install the library, as I could not find the "Sketch" folder they told me to install in. I tried installing into the processing folder itself, then into Core>library, then the "tools" folder, until I got fed up and opened up the Processing application itself. There I just went to Sketch>Import Library...>Add Library... and just looked up LeapMotion and installed it through there. After that I tested the example sketches they had, and then decided to make my own.

import de.voidplus.leapmotion.*;

LeapMotion leap;

void setup{ size(800, 500, P3D); background(255); noStroke; fill(50); // ... leap = new LeapMotion(this); }

void draw{ // Paint with your fingers int fps = leap.getFrameRate; // HANDS for(Hand hand : leap.getHands){

hand.draw; int    hand_id          = hand.getId; PVector hand_position   = hand.getPosition; PVector hand_stabilized = hand.getStabilizedPosition; PVector hand_direction  = hand.getDirection; PVector hand_dynamics   = hand.getDynamics; float  hand_roll        = hand.getRoll; float  hand_pitch       = hand.getPitch; float  hand_yaw         = hand.getYaw; float  hand_time        = hand.getTimeVisible; PVector sphere_position = hand.getSpherePosition; float  sphere_radius    = hand.getSphereRadius; // FINGERS for(Finger finger : hand.getFingers){ // Basics finger.draw; int    finger_id         = finger.getId; PVector finger_position  = finger.getPosition; PVector finger_stabilized = finger.getStabilizedPosition; PVector finger_velocity  = finger.getVelocity; PVector finger_direction = finger.getDirection; float  finger_time       = finger.getTimeVisible; // Touch Emulation int    touch_zone        = finger.getTouchZone; float  touch_distance    = finger.getTouchDistance; switch(touch_zone){ case -1: // None break; case 0: // Hovering // println("Hovering (#"+finger_id+"): "+touch_distance); break; case 1: // Touching // println("Touching (#"+finger_id+")"); break; }   }    // TOOLS for(Tool tool : hand.getTools){ // Basics tool.draw; int    tool_id           = tool.getId; PVector tool_position    = tool.getPosition; PVector tool_stabilized  = tool.getStabilizedPosition; PVector tool_velocity    = tool.getVelocity; PVector tool_direction   = tool.getDirection; float  tool_time         = tool.getTimeVisible; // Touch Emulation int    touch_zone        = tool.getTouchZone; float  touch_distance    = tool.getTouchDistance; switch(touch_zone){ case -1: // None break; case 0: // Hovering // println("Hovering (#"+tool_id+"): "+touch_distance); break; case 1: // Touching // println("Touching (#"+tool_id+")"); break; }   }  }  // DEVICES // for(Device device : leap.getDevices){ //  float device_horizontal_view_angle = device.getHorizontalViewAngle; //  float device_verical_view_angle = device.getVerticalViewAngle; //  float device_range = device.getRange; // } if(mousePressed){ background(255); //clear the screen } }

void leapOnInit{ // println("Leap Motion Init"); } void leapOnConnect{ // println("Leap Motion Connect"); } void leapOnFrame{ // println("Leap Motion Frame"); } void leapOnDisconnect{ // println("Leap Motion Disconnect"); } void leapOnExit{ // println("Leap Motion Exit"); }

For this sketch, all I did was take the first example from the LeapMotion library and told it not to redraw the background, so that it would leave the afterimage of the dots. Then I added a function to click the mouse to blank the canvas.

Colors can be changed by changing the values in background and fill.
 * 10/10/30 ... good starting point .. explore all the examples before working on modifying them ... survey the internet ... try to screen capture a video of each .. --1sfoerster (discuss • contribs) 15:44, 29 April 2014 (UTC)

=Week 4 Narrative=
 * 0/0/0 nothing to grade ... --1sfoerster (discuss • contribs) 13:32, 6 May 2014 (UTC)

=Week 5 Narrative= I got the iRobot home and set about setting it up and connecting it to LabVIEW. I easily found the VI for it in the VIPM by searching iRobot, however I had trouble getting the VIPM to communicate with LabVIEW. I looked up online and tried adding "localhost" to the allowed access, deleting and readding the IP address "127.0.0.1", until I decided to try adding in my own IP address. I am working at a different place than I usually do, and apparently you need to change your IP address to match your current one each time you try to install a VI.

I could not find any examples in package from which to develop an understanding of how the programming worked, and I also cannot figure out how to configure the UART port. I decided to try and find another VI for the iRobot, and found a good one here. []

Still having trouble getting the iRobot and LabVIEW to talk. My suspicion is it has something to do with the UART port, which I still cannot figure out how to configure. I currently have an adapter connecting the robot to a USB port on my laptop. My idea is to find out how my computer identifies that specific USB port and enter that into the UART field.

Found a way to integrate it with the computer here. [=irobot]]. I determined the USB I have it plugged into is called "COM3", but after renaming it I still have been unable to connect. Unfortunately I do not have an FTDI cable to connect as they did in this hack. Trying it in every port on the command module as well as the Mini-Din on the side doesn't seem to work. I tried checking the robot, which came preprogrammed with a couple of its own examples of what it can do, and pressing the play button causes it to play a short song, then go forward until it bumps into something. Afterwards it corrects itself, turns in a direction, and repeats this process until the play button is pressed again. Since this seems to work fine on its own I have determined the problem is not with the robot's programming and with the link between it and the computer.

My next step would be to remove the green iRobot command module and try to connect as they did in the LabVIEW hack.