Author Archives: pgfeldman

Tom DeVito 2.17.2012

Start: 10:00

  • Before I tried sending a buffer over the wire, I checked to make sure the loadBuffer method was working as I had made changes since the last time testing.
  • Loaded the test data into 2 test buffers using for loops.  I completely forgot that you can initialize and increment multiple variables within the for statement.  That could save some typing in the future.
  •   Between yesterday and today’s problems with printing chars which have numeric values stored in them, I decided to change all chars to unsigned 8-bit integers.  When I moused over the windows and arduino send methods, I found this was the default type.
  • I did not know that c had a special data type for size(size_t).  It seems compatible with the most common int types.
  • The array was not printing out the proper results.  It was kind of dumb in retrospect, but I had a variable involved with the initialization of the counter and loop condition, incrementing with the loop.  I took this out of the loop and added it to the size and the problem was resolved.
  • After a lot of work I got the states to change properly when receiving data.  The data on the other hand is messed up.
  • Tried sending the data from the arduino to the pc this time.  The data is transfering up but the first  two bytes seem to be extra communication data.  This is also knocking the message to the wrong place in the buffer.  Found the culprits and took them out.  This works now 🙂
  • Echo test is now working.  I needed to reduce the buffer to find out that there was a message being sent while the other side was trying to process.  Fixed this, I should be able to set the buffer back to 128.
  • Both directions are working without corruption.  Currently this only works for 1 packet of data.

End: 5:30

Mike 2.17.2012

  • Still trying to get a hold of Denise Price regarding the SSP requests she mentioned to Brian
  • Regarding the issues Tangela was having:
    • A fix for the auto-fill is deployed
    • I was able to create a funding request, Tangela was also able to as well, Christina is still having trouble
  • Trying to get Kristi and Dong VRs
  • Studying the basics of the Spring framework

Mike 2.15.2012

Post delayed due to switching servers.

  • Documenting workspace set up guide for Eclipse, GWT, Maven, and Spring
  • Contacted Denise Price regarding SSP changes
  • Spoke with Tangela Hall regarding several issues with the Vis Tool:
    • Auto-fill is no longer functioning in PPM
    • Some confusions regarding project and line item status, this may turn in to a feature request
    • Create Funding Request seems to be broken at site but functioning fine here, I will investigate more tomorrow

Phil 2.17.12

8:30 – FP

  • Started off the day with sprites. Here’s a starfield:
  • The neat thing about this is that the stars are handled as sprites, which means that it’s possible to handle text overlay with a shader now. I think that the way it could be done would be to create a single grid with all the characters and pass that to the vertex shader with the XY index and size of the letter. The vertex shader moves the texture so that the letter is centered and then passes off the texture and size to the fragment shader, which clips the output so only the particular letter is shown. Not going to do that yet, but it’s probably the first tool after I finish the book.
  • Worked my way through the pixBuffer/motion blur section, but I don’t think it’s worth incorporating into the framework.

Tom DeVito 2.16.2012

Start: 9:30

  • Confirmed that the PC is not sending data by opening the serial console in the arduino IDE and sending 1 byte manually.  The arduino’s receive light blinked and the sending light turned on continuously as expected.  It has occurred to me, that it should not be sending messages continuously.
  • Now that the state machine is in better order, I can make the initialization non-blocking.  This was a untested, temporary solution and may be the cause of the PC not sending.
  • Made a change to the windows ComMgr so it will return false if the port does not open properly.  This will trigger an ERROR state, which will print out a “cannot open port” message from ComUtil.  The arduino, being the slave, does not need to worry about this.
  • Sending messages and state changes are now only done after a message is received.  The computer will send the first message on initialization.  Once this happens they will take turns updating each other on their states.  This will hopefully fix the problem with a constant stream of messages.
  • On testing the changes, I have found that the port is opening properly but windows is still not sending anything.  I did make a change to the way the send method works, so maybe I broke it.  The remote state is now properly reporting 0, which is the default state if no message is received.  For some reason, it was reporting 13 before, which made no sense as its not even a valid state.
  • Manual testing of the Arduino with serial console shows that it is now only sending when it receives a message.  The response seems to be corrupted though.    Maybe I am just sending bad data.
  • Found that I was casting the message char as a char*, instead of passing the reference to the char(&char).  Continuing to test with the arduino, but this may solve the windows not sending problem.
  • Tried an echo test once I saw the ardino’s state was not changing.  For some reason it echos back the ascii code.  When the value is set internally it successfully sets and returns ‘0’ but when I send ‘0’ it returns 48.
  • Received data was not being cast to char.  Considering this feeds into a character array which is later ingested by data dictionary, this is actually very important.  This might be the source of all the problems I have had with prior attempts.  The PC would receive good data from anything originating in the arduino, while the data which depended on the PC communication would come back corrupted.  This gave the illusion it was working when I was looking at sensor data.
  • Defined states needed to be characters so I had to put single quotes around them.  I was doing the states differently before.
  • Tested states and it seems to be good for the most part.  There are some possible conflicts with messages and data which need to be resolved.  Since I made it so the packets are 127 bytes instead of 128, I can put the message at the beginning of the packet.
  • Changed and traced the logic of the states.  This was tricky but I think I got something that will work now.
  • Set up testing for large data passing.  I will start this tomorrow.

End: 5:30

Phil 2.16.12

8:30 – 4:30 FP

    • Reflection cube maps today
    • And they are working! The trick to handling rotating reflections is the following (note that the camera matrix is determined before the model roation, and the surface normal is calculated after the rotation.):
	M3DMatrix44f mCameraRotOnly;
	M3DMatrix44f mInverseCamera;
	M3DMatrix33f mNormalMat;

	const M3DMatrix44f &mCamera = modelViewStack.GetMatrix();

	modelViewStack.PushMatrix();
		modelViewStack.Rotate(angle, 0.0f, 1.0f, 0.0f);

		orient44fromMat44(mCameraRotOnly, mCamera);
		orient33fromMat44(mNormalMat, modelViewStack.GetMatrix());
		m3dInvertMatrix44(mInverseCamera, mCameraRotOnly);

		projectionStack.PushMatrix();
			projectionStack.MultMatrix(modelViewStack.GetMatrix());
			glUseProgram(reflectionShader);
			glUniformMatrix4fv(locMVPReflect, 1, GL_FALSE, projectionStack.GetMatrix());
			glUniformMatrix4fv(locMVReflect, 1, GL_FALSE, modelViewStack.GetMatrix());
			glUniformMatrix3fv(locNormalReflect, 1, GL_FALSE, mNormalMat);
			glUniformMatrix4fv(locInvertedCamera, 1, GL_FALSE, mInverseCamera);
			triangleBatch.Draw();
			glUseProgram(NULL);
		projectionStack.PopMatrix();
	modelViewStack.PopMatrix();
  • It seems to be a nice day for pretty pictures. Here’s an example of multitexturing:
  • And now that our connection is better, maybe I’ll install R on fgmdev

Tom DeVito 2.15.2012

Start: 9:30

  • Made a lot of small changes to fix minor issues and finished some methods which were missing parts.
  • Tried testing it.  Seems that the sendData is not working at the moment.  The light did not light up on the arduino.
  • I was testing it outside the library before.  It seems the port is not opening properly from inside the library.  I thought this might have to do with members of static libraries not being able to have instance of classes in them, but Phil told me that’s most likely not the case.
  • Its a bit tricky to make a library project into an exe for testing so I might just copy all the classes into an exe project.
  • I am wondering if I would be able to test the communication with another windows machine hooked up by usb.  This would be a better way to troubleshoot as I could easily display outputs.  I am not sure how both machines would open the port though.

End: 6:00

 

Phil 2.15.12

8:30 – 4:30 FP

  • Making good, albiet slow progress on shaders. It’s kind of like programming in pre IDE-days; edit in vim then submit to the GPU compiler for a cryptic message. On the list of things to do is a framework that allows for the more sophisticated editing of shaders in the context of a running program. Will probably do this is Java for eclipse. Looks like there’s a starting point here: http://glshaders.sourceforge.net/
  • Nice progress so far. Let’s see if this video uploads…
  • solarSystem
  • Useful post on how to make a skybox with photoshop: http://www.interlopers.net/forum/viewtopic.php?f=44&t=31549
  • Going to set up a new project – ShaderLearning2
    • Use frame this time in Gl_ShaderWindow. Nope, I need Euler Angles for this.
  • Need to install R on the new server.

Tom DeVito 2.14.2012

9:30 -2:00 Tech support

  • After many e-mails and phone calls, it looks like the server is now operational and fgmdev.com is pointing to it.  We still need to transfer domain ownership once we get a account with http://www.enom.com
  • Everything is the same on the new server; if you need to ftp, make sure your using sftp.
  • I need to figure out how to reset RSA key so I can SSH in.  Just noticed this at the end of the day, so I’ll look into it tomorrow
  • Noticed the printer had printed out a bunch of junk last night.  I am not sure why this happened,  but I found that there was a firmware update, dated sometime last month.  Hopefully it works better in the future in general
  • Called Comcast about outages, looks like they finally got around to fixing the problem

2:00-5:30

  • I think I finally got the state machine working right.  I will have to examine this more closely tomorrow.

char ComUtil::changeState()
{

if(_rState == RTS && (_lState == READY || _lState == DONE))  //Receiving states  I think it is important that this is checked first
_lState = CTS;
else if(_rState == SENDING && _lState == CTS)
_lState = RECEIVING;  //Stay in this state til all packets are sent

else if(_hasData == true && (_lState == READY || _lState == DONE)  && (_rState == READY || _rState == DONE))  //This state only happens on first send of if the receiver has nothing to send.  Finished Processing automatically put the receiver into a RTS state if it has data
_lState = RTS;
else if(_rState == CTS && _lState == RTS)
_lState = SENDING;

else if(_rState == SENDING && _lState == ACKNOWLEDGE)
_lState = RECEIVING;
else if(_rState == ACKNOWLEDGE && _lState == WAITING)
_lState = SENDING;
else if(_rState == DONE && _lState == ACKNOWLEDGE)  //When the last packet is sent the sender goes into a DONE state
_lState = PROCESSING;

return _lState;
}

  • This method feeds into a switch statement which looks for SENDING and RECEIVING states.  These two states require more then a simple change of state, which is why they are processed separately.  Once one side sends something it goes into a WAITING, depending on how many packets are to be sent.  It will stay in that state til it gets an ACKNOWLEDGE from the other side.  Likewise if the local state is RECEIVING, it will change to ACKNOWLEDGE after it receives.  On the last packet sent, the sender goes to a DONE state which triggers the receiver to go to a PROCESSING state.  It stays in the PROCESSING state til an external element calls the finishedProcessing() method.  Once finished processing, the receiver goes into either a RTS or DONE state, depending on if it has data.
  • Added a public boolean method called isProcessing(), so the data dictionary will know when it needs to ingest data.
  • If the sender goes into a DONE state after the  last packet sent, number of packets sent does not need to be sent across the wire.  This means each message is only 1 byte, as only the state needs to be sent.
  • The inclusion of the WAITING and ACKNOWLEDGE states, should fix the problems I found while testing on Monday, where it was sending more data before the other side was ready.

End: 5:30

Dong Shin 02.10.2011

  • Spring Roo doesn’t parse complex tables (and relations) correctly. Somehow it throws exceptions when try to access some tables. Looking at other things.
  • Sidetracked to Spring, Hibernate, Struts2 training
    • very good video tutorial at http://javabrains.koushik.org/ (long, really long)
    • Hibernate Tools has capability to reverse engineer database
    • sample Hibernate project using MySQL
      • svn://fgmdev.com/trunk/Sandbox_folders/DONG_SANDBOX/HibernateProj
  • putting Maven, GWT, Spring, Hibernate together

Phil 2.10.12

8:00 – 6:00 FP

  • Cleaning up the texture allocation scheme by going to a singleton class like Dprint. Nope, after looking into it, the glGenTextures is guaranteed to return unique handles to textures each time it’s called.
  • Pretty picture:
  • Oh, boy, I get to redo my security form! I guess that’s what I’m spending the rest of the day on.
  • But then the Internet broke, and I had my graphics book cached locally. Can’t work on forms. Darn.

Tom DeVito 02.09.2012

#NOTE:  Communication the right way
Start: 10:00

  • Okay, so I guess my concerns about the programs running at different speeds were not unfounded.
  • To solve this problem it takes multiple cycles to send and receive data.  Before I was worried about loss of data, but the cycles should be fast enough, that the polling rate won’t suffer.
  • The first initializing pass, gets both devices to a Ready state.  After this parts done, the program goes through its first loop and the buffer is loaded with the first set of data.
  • On the second loop, it first checks to see if there is any data in the buffer, if there is it locks the buffer til data is sent.  After this happens it will check to see if it received any messages.  If it has not, it will send a ReadyToSend(RTS) message across the wire and wait for a ClearToSend(CTS) response.  If it has it will change to a CTS state and send a response.
  • On the “third” loop, the RTR side will send a message of send 1 of x packets and will wait for a response before  sending the next packet.  This will take x amount of loops to send all the data.
  • Once all the packets are received the sending side goes into  done state and the receiving side goes into a processing state.  When the data is done being ingested the reciever will respond done and the sender will go into a CTS state and the original receiver will have a chance to send its data.
  • If the original receiver has no data to send it will send a no data message which will trigger the original sender to either go into a RTS or READY state depending on if it has data or not.
  • I think I finally get how to do this properly.  Just need to edit my states to mirror the process outlined above.
  • I have realized that the only thing that each side really cares about is the State of the other side.  I took out all the command and response variables for each side and replaced them with a simple local state and remote state.  When sending and receiving occurs, a special message with state and packets of total is sent.
  • Got rid of master flag as it is no longer needed.
  • Made sure the the class always tries to receive before sending.  This eliminated a need for a separate response method and makes it so both types messages are the same format.
  • Got rid of some other methods which were the product of over thinking the problem
  • For now only 1 packet will be sent at a time to simplify troubleshooting.

End: 6:00

Phil 2.9.12

8:00 –  4:30 FP

  • Onward to the next chapter!
  • Texture maps – we get to make shiny things…
  • Adding a callback to the main window so that textures are released on closing.
  • Textures are working! Going to make things a bit fancier tomorrow.

Tom DeVito 02.08.2012

Start: 10:00

  • Everything that worked before seems to work now.  The standard message passing now works on a continuous loop.
  • I have only tried single passing data
  •  Testing DataDictionary ingesting
  • Fixed a problem with the ingesting if there was no data in the buffer

End: 6:00