Author Archives: pgfeldman

Tom DeVito 2.07.2012

10:00:  The first two hours today were devoted to getting paperwork in for my clearance.  Lots of headaches with scanner and both gmail and fgm mail but it is hopefully done for the final time.

Start: 12:00

  • I still don’t really understand how something can get there first if the receive method is called after the send method.  If the receive method was on a separate thread then it could just constantly loop til it receives something, but this is not the case and I am not sure if the arduino is capable of multi-threading.  So the way I decided to make it work is have both sides send their messages and then process them from the buffer into their appropriate remote message buffer.  After this point the master gets the first opportunity to receive a response and the slave the first chance to send a response.  Once whatever process is done the roles get reversed.  This essentially works the same way as you described yesterday, but prioritizes the Ready to Send state to the master first.
  • I believe both PC com and arduinos com are technically on their own thread-like thing.  The issue is if too much is sent before the arduino gets to process it, it will overflow.  This is not really an issue on PCs because they have much larger buffers.
  • Working on revising tests for new set-up

End: 6:00

Mike 2.7.2012

So it turns out I am neither crazy nor as inept as I thought and what I’ve been trying to do can’t be done.  I’ve been trying to combine Eclipse Indigo (3.7) + m2Eclipse + the Google Eclipse Plugin and a few other things to make the best development environment possible.  But there’s currently an issue with GWT 2.4.0 and the Google Eclipse Plugin + m2Eclipse.

Phil 2.7.12

8:30 – 5:00 FP

  • Working on how to chain matrices.
  • Old-school:
  • glRotatef(eyeOrient[0], 1, 0, 0);
    glRotatef(eyeOrient[2], 0, 1, 0);
    glTranslatef(eyePos[0], eyePos[1], eyePos[2]);
    
    // global world transformations
    glTranslatef(worldPos[0], worldPos[1], worldPos[2]);
    
    glRotatef(worldOrient[0], 1, 0, 0);
    glRotatef(worldOrient[1], 0, 1, 0);
  • And How it’s done now:
  • m3dLoadIdentity44(workingMatrix);
    m3dLoadIdentity44(worldMat);
    m3dLoadIdentity44(eyeMat);
    m3dLoadIdentity44(tmat);
    m3dLoadIdentity44(rmat1);
    m3dLoadIdentity44(rmat2);
    
    // handle eyepoint transformations
    m3dRotationMatrix44(rmat1, eyeOrient[0], 1, 0, 0);
    m3dRotationMatrix44(rmat2, eyeOrient[2], 0, 1, 0);
    m3dTranslationMatrix44(tmat, eyePos[0], eyePos[1], eyePos[2]);
    
    m3dMatrixMultiply44(eyeMat, rmat2, eyeMat);
    m3dMatrixMultiply44(eyeMat, rmat1, eyeMat);
    m3dMatrixMultiply44(eyeMat, tmat, eyeMat);
    
    // handle global world transformations
    m3dTranslationMatrix44(tmat, worldPos[0], worldPos[1], worldPos[2]);
    m3dRotationMatrix44(rmat1, worldOrient[0], 1, 0, 0);
    m3dRotationMatrix44(rmat2, worldOrient[1], 0, 1, 0);
    m3dMatrixMultiply44(worldMat, rmat1, rmat2);
    m3dMatrixMultiply44(worldMat, tmat, worldMat);
    
    // combine the eye and eorld xforms
    m3dMatrixMultiply44(workingMatrix, eyeMat, worldMat);
  • Isn’t that better?
  • Ok, cleaned things up a bit, and now I’ve got something I can live with:
  • // global eye transformations
    modelViewMatrix.Rotate(eyeOrient[0], 1, 0, 0);
    modelViewMatrix.Rotate(eyeOrient[2], 0, 1, 0);
    modelViewMatrix.Translate(eyePos[0], eyePos[1], eyePos[2]);
    
    // global world transformations
    modelViewMatrix.Translate(worldPos[0], worldPos[1], worldPos[2]);
    
    modelViewMatrix.Rotate(worldOrient[0], 1, 0, 0);
    modelViewMatrix.Rotate(worldOrient[1], 0, 1, 0);
  • Putting the stage and other bits in

Tom DeVito 2.06.2012

Start: 11:30

  • Fixed the methods which have to do with commanding and response
  • Fumbled a bit trying to figure out the logic for how this should work.  I was concerned about differing rates of the programs, as well as how to make sure that they both don’t try to send at the same time.
  • Talked to Phil about the problems above.  He said the difference in the computer and arduino processing speed should not be an issue, as well as that one message will get there first so as long as it changes the state, there should be no conflict.
  • Working on changes to reflect the above.

end: 6:00

Phil 2.6.12

8:30 – 5:30 FP

  • Hey, it’s my 2 month anniversary of my broken leg. On the whole, progress has been pretty good.
  • Working out how to put all the matrix pieces of a shader system together.
  • After flailing for pretty much most of the day, I discovered that I had set up the view frustum incorrectly, due to a typo. Most things work, but the viewframe isn’t reset ti identity each time through. I need to revisit how to set that up.
  • This was the hint that clued me in, BTW. Yuck.

Tom DeVito 02.05.2011

Start: 5:30pm

  • Continued the work started on Friday
  • Added more comments and fixed spacing to make code more legible
  • Did somewhat of an overhaul on how the ComUtil class works.  Most methods were changed and many were added.  I think I was missing an important part of the concept of how this should work before.
  • Added a WAITING state.  This state is set whenever a command is sent and its waiting for a response.  While in this state it only checks for a response.  A response only comes after the command is completed.
  • Added a set state method.  This checks if its in the proper state for a change to occur.  setStates can only be done when the currect state is READY.
  • Changed the processing of incoming messages and responses
  • I feel the new approach makes things more predictable, so there should be less issues with messages being sent at the wrong times.
  • I need to finish up some stuff, but sometime tomorrow, I would appreciate if Phil reviewed the code.

End: 9:30pm

#NOTE:  The opportunity to Send and Receive data have to be in each single pass.  Otherwise this class will have to run on a faster loop then the rest of the system to accommodate multiple passes.

Tom DeVito 02.05.11

Start: 10:00

  • Moved ComUtil and its test code into the the ComConsole library
  • Changed it so instead of having slave and master the variables are remote and local.  Also added a response instead of using a command like structure for both transmitting and responding
  • Cleaned up the code a bit and added comments, in case I don’t get a chance on the weekend to get it working.  Should be easier to show Phil whats going on with it.
  • Adjusting the states to work with the changes to the varibles

End: 6:00

 

Dong Shin 02.03.2012

import org.newdawn.slick.TrueTypeFont;

private TrueTypeFont font;

private TrueTypeFont font2;

public void init() {

// load a default java font
Font awtFont = new Font(“Times New Roman”, Font.BOLD, 24);
font = new TrueTypeFont(awtFont, antiAlias);

// load font from file
try {
InputStream inputStream = ResourceLoader.getResourceAsStream(“AnnabelScript.ttf”);
Font awtFont2 = Font.createFont(Font.TRUETYPE_FONT, inputStream);
awtFont2 = awtFont2.deriveFont(24f); // set font size
font2 = new TrueTypeFont(awtFont2, antiAlias);
} catch (Exception e) {
font2 = new TrueTypeFont(awtFont, antiAlias);
e.printStackTrace();
}

matStage.init();
}

public void render() {

GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, width, height, 0, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
Color.white.bind();

font.drawString(100, 50, “THE LIGHTWEIGHT JAVA GAMES LIBRARY”, Color.yellow);
font2.drawString(100, 100, “NICE LOOKING FONTS!”, Color.green);
GL11.glDisable(GL11.GL_BLEND);

}

Tom DeVito 2.2.2011

Start: 10:00

  • I decided to change the way handshaking works so it only sends status messages when the status changes.  I am sure the computer doesn’t care how fast these messages are going back and forth, but it is much easier for me to ensure synchronization this way.
  • I am not sure why I thought the ReadFile method was blocking.  It seems it just returns false if there is nothing to read. I did a  test to confirm this.
  • Fixed an error if nothing was connected
  • Added error messages to the toString method
  • ComUtil uses a class called printable which is in the ComLib.  Any class can inherit from this in order to print data or error into the console.  It has a limited number of rows but should suffice consider most data will output on the  simulation interface.

End :6:00

Mike 2.2.2012

Tom DeVito 2.1.2012

start: 11:00

  • Handshaking works all the time as long as it starts in a sync state.
  • I can send large files manually but it seems to break after the first time.  Handshking still appears to work when this is not.
  • Commented out all send and receive methods and changed it to talk to a class passing the information in a similar manner like it was over the wire.
  • Tracing through the states to see where the problem is occuring

end: 6:00

Phil 2.1.12

8:30 – 4:30 FP

  • Starting the OpenGl SuperBible 5th Edition, which covers OpenGl 3.0+
  • Hmm. Can’t check out code from svn http://oglsuperbible5.googlecode.com/svn/trunk/
    • Here’s the useful SVN fix of the week: “SVN uses a few HTTP commands that not every web proxy and/or firewall understands, which can lead to errors. There is one thing that might fix this for you, and that is to use HTTPS instead of HTTP, because then the 
      connection is encrypted and any proxy/firewall in between can’t mess with the content. I checked, and the server provides HTTPS access, although that is not necessarily always the case. “
  • Ok, after some heroic struggling with getting libraries to behave and dealing with static declarations, I can now draw a simple triangle. I’m going to try to do the same in FLTK now, since I’d like to get away from static libraries…
    • Got a basic Shader Window framework compiled. Will test tomorrow.

Tom DeVito 1.31.2012

Start: 10:00

  • The project was set to include libraries from the original directory it was in.  Changed it so it would use the folder within the projects root.
  • Fixed a problem where items larger then 128b, were not breaking into smaller packets properly.
  • Added checks to make sure the larger buffer wasn’t too big
  • Add more checks for null pointers so the program doesn’t crash

end: 6:30