Monthly Archives: January 2012

Dong Shin 01.13.2012

  • LoadApplet GWT Application
    • http://www.fgmdev.com:8080/LoadApplet/LoadApplet.html
    • loads Java Applet specified in the main
    • uses JSNI to communicate with the Applet
    • Test3DApplet.java has examples of calling Applet’s methods and specifying the callback from the Applet
      • public native void setColor(String color) /*-{
        $wnd.document.getElementById(“myApplet”).getApplet().setColor(color);
        }-*/;

        public native void getFramerate(Test3DApplet x) /*-{
        $wnd.showFrameRate = function(frameRateStr) {
        x.@com.fgm.loadApplet.client.applet.Test3DApplet::showFrameRate(Ljava/lang/String;)(frameRateStr);
        }
        //        $wnd.showFrameRate(“01000”);
        $wnd.document.getElementById(‘myApplet’).getApplet().getFrameRate(
        “showFrameRate”);
        }-*/;

        public void showFrameRate(String frameRateStr) {
        GWT.log(“frameRate: ” + frameRateStr);
        frameLabel.setText(“Framerate: ” + frameRateStr);
        }

    • checked into /Sandbox_folders/DONG_SANDBOX/LoadApplet

Phil 1.13.12

8:30 – 4:30 FP

  • Interview
  • Spent some time with Tom talking about sending data between two data dictionaries
  • Building a Finger on my way to building a RightHand
  • Hand graphics are done, now working on getting the fingertip positions in word coordinates.
  • Think I found it here: http://lwjgl.org/forum/index.php?action=printpage;topic=1866.0 My version of the code follows:
	protected float[] getGlMatrix4x4(int matrixId){
		float minv[]=new float[16];
		ByteBuffer temp = ByteBuffer.allocateDirect(64);
		temp.order(ByteOrder.nativeOrder());
		GL11.glGetFloat(matrixId, (FloatBuffer)temp.asFloatBuffer());
		temp.asFloatBuffer().get(minv);
		return minv;
	}
  • Need to test this on Monday
  • Cute thing for the day:

Tom DeVito 01.12.2012

Start: 9:00

  • Figured out what was wrong with the responses.  They were being entered into the dictionary by the class above them, so when the child class created them the entry already existed.  Originally the subscribe/publish methods were returning the dataelement, so I changed it to return the data pointer instead and set the local pointer to the result of these methods.
  • C++ does not have a standard super keyword for dealing with super classes because of multiple inheritance.  Parentclass::method seems to work though.
  • Pure Virtual needs to be defined to be used on the arduino similar to the way new and delete do.
  • Here is a useful link for fixing problems with c++ on the arduino: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=410870
  • Pure Virtual is not needed for what I am doing.  It makes the method abstract as opposed to being able to override it.
  • Strange problem with the arduino initializing the child classes of controller.  For some reason sargent works fine.  The others end up in an infinite loop of initialization.  There is nothing obviously different about how these classes are initialized.
  • Not sure why it was looping before, now it only does it if I have two initializing at the same time
  • The sequence of checkpoints goes 1,2,3,4,5,1,1,2,3,4,5,1,1,2,3,4,5.  The five is part of the sargent’ s classes of special init class, so it seems to be resetting.  If I take sargent out, lieutenant does the same thing, when private is also initialized, but only counts to 4 cause I didn’t add one to its own init.
  • The problem was a memory overflow.  The command, state, and response classes had 255 byte names.  These quickly filled up the 8kb of arduino sram.  Once everything is working well, I am going to go back and make these classes and the way they work with the controller more efficient.
  • Before I start playing with the ComUtil and wired communication, I am going to write a debug utility class to make debugging on the Arduino easier.
  • Checking out Apache log4cxx
  • Decided to hold off on this til after the communications are working.  The main reason is because I have very limited ability to print straight from the Arduino.  I already have a console class which can handle displaying messages like this.
  • Dropped the working classes from the testing project to the arduino project and committed the changes to subversion.
  • I did not realize we only had 8kb of memory.  If I am using a 1024 char buffer for ComUtil I am using 1/8th the running memory just for this.  Maybe I should send each remote entry individually, instead of sending all at once.
  • When asking Phil what the largest thing would be that we need to send over the wire, he said the logger would be.  I am thinking that the log data can be stored as elements which the PC side can decode into strings that are meaningful.  This would cut down the memory usage of the logger.  This may be a bit more difficult then I think.
  • I am going to leave the com buffer at 1024 for now, if we run out of memory, we will know where to cut first.

End: 5:00

Arduino Mega(2560) Memory Specs:  256kb storage space, 8kb SRAM for running programs, 4kb EEPROM for storage of variables you want to persists even when the Arduino loses power.

Possible solution if we run out of memory: http://hackaday.com/2011/09/07/want-2-megabytes-of-sram-for-your-arduino/

How store variables in the flash memory instead of SRAM: http://www.arduino.cc/en/Reference/PROGMEM (I’ll test this out, once the communication is working)

Phil 1.12.12

8:30 – 4:30 FP

  • Talked to Dong about setting up a demo of communication between GWT and My test applet. Pleasantly enough, the JS2Applet webpage runs fine on Macs.
  • Cylinders and a hand next, then time to integrate with FLTK for the next couple of days.
  • MaterialCylinder is done
  • Hey! The Red Book is online! And the Blue Book. All at glprogramming.com under “links”. Nice site.
  • Put together a nicer applet for Dong. Starting on fingers now.

Tom DeVito 01.11.2011

Start: 8:30

  • Added subordinate commands and responses to the top and mid level controller.
  • Publish is for the class writing to the variable, subscribe is for the class reading from the variable.
  • There was no set way to set command.  Phil made some changes to be able to do this.
  • Changed response to work like Command.  Added setEcho method.  State seems to have already been working in a way where its set by static states.  Made lots of little improvements to these classes
  • Need to add toString methods to everything
  • Made a ton of changes, command is working properly, response is not.

End: 6:30

 

Phil 1.11.12

9:00 – 6:00 FP

  • Working on getting meshes working. I’m trying to use Matrix4f to position all the points. It’s tricky, but if I can get it to work, then I can get the inverse transform to provide me coordinates for collision detection in the world coordinate frame.
    • Just not getting there. Going back to basic formulas. Sigh. We loves the Wolfram, though.
  • Adding mouse interaction
  • Added a stage.
  • Added spheres. There is a problem where 16 divisions causes a null exception, but 18 does not. Need to check that out.
  • Cylinders tomorrow
  • Cool picture for the day:

Phil 1.10.12

8:00 – 4:00 FP

  • Hmmm. THis didn’t post yesterday. Odd.
  • Tom did not check in his work from last night. Waiting for a 9:00 show?
  • Porsche at 10:30
  • Worked on Command, Response and State. Also put together an example of Decision Process code in the base Controller class

Mike 1.10.2012

  • Finished the GeoEncoder, it’s available in our SVN at /trunk/Java_folders/Projects/GeoEncoder
    • It works pretty well but will likely need tweaks and will become more developed as it sees use
    • It should work on any MySQL table that contains addresses, it expects 3 columns: street address, city, and state but should work fine if all three are lumped in to one column
    • the minimum requirement for an address is the state, geoencoding ‘MD’ would just give a lat/lng of the center of Maryland
    • Each lookup takes about 1/3 a second on my wireless connection here
  • Working on making a few more charts in AppBoard
    • One chart which displays donations by state over time, grouping states the following way: RI, NY+NJ+MA, Rest
    • A query that returns donations by year for ‘Rest’: SELECT substr(GFDate, length(GFDate)-3, 4) as year, sum(GFAmt) FROM `test`.`donors` WHERE AddrState <> ‘MA’ AND AddrState <> ‘NJ’ AND AddrState <> ‘NY’ AND AddrState <> ‘RI’ GROUP BY year;
    • Another chart that breaks down the donors by Top 3 givers, Top 100, Rest each year.
    • A query that gives the top 3 donors of 2011 SELECT substr(GFDate, length(GFDate)-3, 4) as year, sum(GFAmt) as sumGift, ImportID, FullName, AddrStreet FROM `test`.`donors`
      WHERE GFDate LIKE ‘%2011’ GROUP BY ImportID ORDER BY sumGift DESC LIMIT 3;

Tom DeVito 1.10.2011

BOLD = PLEASE READ

Start: 9:30

  • Working with Phil on primarily the controller class so far.
  • Phil had to step out so I am working on the DataDictionary
  • Changed all the isRemotes to isLocal to keep with the theme of the other classes
  • Added a addItem method which takes in DataElements.  Now you can either add a new entry with all parameters or add a DataElement.
  • Made the old getItem private.  This method is used internally but from what I can tell, publish or subscribe will take its place in external use.
  • Took the DataElement variables out of the struct.  This was obsolete code, the newer serialize method only takes the name and data, so the struct wasn’t really required anymore.
  • Added publish and subscribe methods.  I am not sure if I understand the purpose correctly, but I think it is to get the pointer to the entry no matter if it already exists or not.  I was also confused by why we would want two methods that do the same thing, but I guess the owner will publish, and the other classes, that want the data, will subscribe.
  • Moved sendRemoteData to private.
  • Committed changes to the 4 files involved with the DataDictionary/Element classes.
  • More changes to the Controller class were made, Phil wants me to make a test program for controller and related classes.
  • Cleaned up all compiler errors.
  • Added TempControllerTest(executive), TempSrgt(Top-level controller), TempLt(Mid-level controller), and TempPrivate(Low-level controller) classes to the project, to test everything related to the controller.  Once a local test works, I will have to ask Phil how to best handle remote data.
  • Parent class methods which are virtual, can be called using __super::nameOfMethod.
  • Eventually figured out why it kept telling me the child classes of controller were being considered abstract.  Apparently setting a method to equal zero makes it abstract.  This was actually in the wiki (= 0) but I thought it was an emoticon someone stuck in there…
  • I didn’t get much done because it took me so long to figure that out, but now that is done it shouldn’t take long to finish the local tests.
  • I will need to finish the classes for the test tomorrow and then update the arduino classes to test remote data.  Setting up the remote data test may also require changine the way stuff is sent over the wire.  How it is currently done is described below.

 

  • EXPLANATION OF HOW THINGS GO ACROSS THE WIRE CURRENTLY:  The way I have it set up, the entries are iterated through and the remote objects are added to a buffer.  This buffer  is then sent across the wire and the import method places everything in the correct place on the other side.  The way its currently set up, only name and data are transferred.  It is assumed the name, size of data, and isLocal will never change after initialization of the DataElement and will be uniform on both sides.  This process is handled by the sendRemoteData() method, which was designed to be run only by the executive at the end of a cycle.  Any suggestions on how to do this better are greatly appreciated.

End: 5:30

Tom DeVito 1.9.2011

Start: 11:30

  • Moving all the common classes over from the arduino to the pc.
  • The pc uses a different string class.  Hopefully this does not mess up the response and command objects.
  • Noticed that I was not passing the instance of the dd to comutil, on the arduino side, while changing the PC version
  • Fixed all the compiling errors on both the Arduino and PC
  • Tried launching the interface. For some reason its not drawing properly
  • Worked with Phil on the Command, response, state, and controller class.  Still working on some of the changes to these classes.

End: 6:30

Thomas DeVito 01.08.2011

Start: 2:00pm

  • Took inventory of all the classes and found out which ones needed methods added to them
  • Focused on the arduino side.   Made lots of changes to the DataDictionary, DataElement, command,  response,controller, and ComUtil.
  • Changes to the Controller class made it so Audio/Sensor element had to be rewritten.  This shouldn’t take long but I ran out of time last night.
  • I did not get a chance to do much with the PC side, but many of the classes I fixed on the arduino side are used by both.
  • Both sides need the main rewritten.  I expect to be able to do this by the end of day monday along with the revised audio/sensor controllers on both sides.

End: 12:00am

Phil 1.9.12

8:30 – 5:00 FP

  • Onward with shaders…
  • Building a torous
  • Checking out FLTK from here: https://svn.easysw.com/public/fltk/fltk/branches/branch-1.3
  • Started on getting Tom’s code to work.

Dong Shin 01.06.2012

  • deployed the latest PPM and PA
  • reviewed with Tangie
    • She wants to be able to review the budget amounts info for individual sub projects
  • working on viewing budget amount of sub projects
    • query to retrieve yearly budget amounts
    • SELECT c.uid , SUM(amount), year
      FROM budget_centers c
      LEFT JOIN budget_amounts a
      ON c.uid = a.budget_center_id
      WHERE project_id = 99
      GROUP BY year
    • made windows non-modal, can view multiple projects. close all on Create Project panel close

Phil 1.6.12

8:30 – 430 FP

  • Just for kicks, looking for Arduino communication from Java, basically ’cause I don’t want to fry my brain switching gears to C++ if I don’t have to.
  • From http://www.arduino.cc/playground/Interfacing/Java:
    • The Arduino IDE itself is written in Java, and it can communicate to the serial port via the RXTX Java library. That library is very similar to the Java Communications API extension. Internally the IDE remembers which port and baud rate you used last time. Unfortunately that internal implementation can not be considered public API you can reliably use. So you will have to keep your own settings to remember which COM port your Arduino card is using.
    • Getting the Arduino IDE for windows: http://arduino.cc/en/Main/Software
    • Following along with the “Getting Started” instructions pointed to by the IDE. IN my case, they are installed with the software from the above step at file:///C:/Arduino%20IDE%20distros/arduino-1.0/reference/Guide_Windows.html
  • Installed Visual Studio – that took a while…
  • Working on hand modelling

Tom DeVito 01.05.2012

Objective:

  • Work out the bugs in Sound Controllers and related classes

start: 10:15

  • Fix a problem with the loadBuffer method of ComUtil causing it to mess up when more then one item was loaded.
  • Fixed a problem where commands uid were not properly incrementing.
  • Decided it would be easier to debug the sensor master first because it works the same way but is much less complex and easier to test by printing out the data.
  • Cleaned up the obsolete code on PC side

End: 6:15