Category Archives: Feldman Project

Phil 1.20.12

8:30 – 5:30 FP

  • Since I have to change my insanely long FGM password, I swing by the customer to check all my passwords. They won’t need changing for a while. Looks like FGM’s password schedule is now at a different frequency. More stuff to remember. I think it’s crowding out the calculus.
  • Working on the Fl_GL_Window extension (Gl_View_Window) that will handle the drawing of all the items in the universe. Got the callback working nicely.
    • Add mouse functions for world and camera control – mostly done.
  • Working out how to set up callbacks using Fluid. Remarkably, it seems to be making sense.

Phil 1.19.12

8:30 – 4:30 FP

  • Gave Dong my copy of the OpenGl Superbible so he can have a good grounding
  • Set up a window in Fluid that has all the pieces needed for display and testing
  • Figure out timers in C++ (FLTK?) and incorporate. Working, though I can’t get a callback to work inside of a class. I may need to go to FLTK 3.0? Downloading and testing. Nope, doesnt work.
  • The way you do callbacks with classes is to have the callback be static. You pass the “this” address of the class in so that you can work with the class that is active at the moment. This is covered in detail here: http://www.fltk.org/articles.php?L379+I0+TFAQ+P1+Q, which is from the generally useful http://www.fltk.org/articles.php?L+TFAQ

Tom DeVito 01.18.2011

Start: 10:00

  • Trying to get AVR-Studio to work
  • In order to use it with c++ you have to install an extension from tools -> extention manager
  • Finally included all the dependent files, I can actually start debugging now.  There might be a better way to point it at the directory but for now I just dropped them all in.  The files were in arduino_roothardwarecoresarduino
  •  Apparently you can drop a built .elf file into the the debugger from the arduino.  I haven’t figured out where this file is located yet though.  Its supposedly in the temporary folder the arduino uses before deploying to the chip.

End: 6:00

Phil 1.18.12

8:30 – 4:30 FP

    • Asked Dong to look at setting up the first pass of the chart applet using the potatoland.org/gl code as a possible foundation, since it seems to be the best example of working text overlays.
    • Getting openGL running in FLTK, then porting the hand
    • Got the CubeView program compiling and linking. To do this, I pointed the “additional include directories” to point to C:/FLTK/branch1.3, which has FL/ underneath it. Then I pointed the “additional libraries directories” to C:/FLTK/branch1.3/lib. The last thing I had to do was point at the proper libraries (note that these are debug directories):
      • glu32.lib
      • fltkgl.lib
      • fltkd.lib
      • wsock32.lib
      • comctl32.lib
      • opengl32.lib
    • Once I got the system running, there were piles of “PDB” warning messages (i.e. “‘C:WindowsSysWOW64ntdll.dll’, Cannot find or open the PDB file “). You can fix these by getting the debug symbol tables from microsoft:
      •  tools->options…
        • Choose Debugging->Symbols from the list, then check “Microsoft Symbol Servers” then click OK and rebuild. Here’s a screenshot
    • Having an odd problem with setting the background color. I need to set the glClearColor() in the predraw, before every frame, otherwise it comes up as black. Not sure why.
      • Turns out that in FLTK GL windows, the graphics context is reset after things like a resize. THis means that the init code can’t be in the constructor, but rather needs to be in the draw function in the following way:
	drawUniverse(){
		if(!valid()){
			glEnv->init(w(), h()); 	// called when the context
						// has been (re)created
		}
		glEnv->predraw(w(), h());
		draw();
	}

Tom DeVito 01.17.2012

Start: 9:30

  • I don’t think there could be anything wrong with ComMgr but I am going to retest it to make sure.  ComMgr is the class that sets up the port on the PC side and has the most basic methods for sending and receiving data.  These seem to be working but it can’ t hurt to be sure.  This should not be confused with ComUtil which is the more specialized class.
  • I now know for a fact that the packet is built and sent properly from the PC.  The arduino doesn’t seem to be recieving properly.  I think the buffer might be getting overflowed even though I am only sending 128 bytes.
  • Might have found a better way.  Firmata is a firmware for the arduino which allows the computer to communicate to the arduino directly.  If this works it would mean that all of our software can be on the PC side which would make debugging much easier.
  • How to set it up: http://www.arduino.cc/playground/Interfacing/Processing
  • The cpp message host doesn’t seem to be available.  It would be pretty easy to make one but I would still need the communication to work between the PC and arduino to do this.  The firmata message protocols are straight forward so it might be worth doing at some point.
  • I found this shortly before leaving today: http://www.atmel.com/dyn/products/tools_card.asp?tool_id=17212&source=getting_started
  • Its is a IDE for AVR chips.  From what I read it has a good debugger.  I probably didn’t find it before because I was looking for something specific to the Arduino.

End: 5:30

Phil 1.17.12

8:00 – 5:00FP

  • Continuing on with collision detection
  • But first, I need to be able to see a text overlay. Looks like lwjgl has this with their Slick-Util lib. Ugh. This is getting harder than I was hoping….
  • Moving hand code over to MSVC, after installing updates
    • Building the debug and release dlls
  • Another take on 3D. This works in your iPhone: http://css-3d.org/. An example of a website that uses this is http://acko.net/. And there’s http://mrdoob.github.com/three.js/, also. It’s a JavaScript library that renders to WebGL or SVG
  • Getting Started with Three.js

Tom DeVito 01.16.2012

Start: 8:30

  • Changed the DataDictionary to send one item at a time over the wire when it sends them.
  • Made a test environment for the ComUtil class independent of the datadictionary.
  • Solved a lot of issues with variables not being initialized but there still is problems
  • The arduino is not waking up after the first packet is sent to it.  I see the led light up indicating the packet was received but it doesn’t start sending data.
  • I am not going to commit these classes because I might want to reset them back to the way they were.  They worked somewhat before.
  • I was not feeling well today.  Maybe I am missing something obvious.  Hopefully tomorrow I will feel better.

End: 4:30

Phil 1.16.11

8:00 – 3:30 FP

  • Working on getting the fingertip positions out of the modelview matrix
    • mat[12] = x
    • mat[13] = y
    • mat[14] = z
  • Added the ability to change colors in the hand and joints for Dong’s test. It didn’t work on his machine at home?
  • There is something odd about how the model view matrix is being affected by the fingers? Nope – just had the test transformations happening while the view transforms were still on the stack. So local to global coordinate transformations are working. That was *much* easier than I expected.
  • Building collision detection into sphere and box. Rather than reinventing the wheel, I’m going to see if I can use a library. Checking out bulletphysics.org, and the java implementation, JBullet

Tom DeVito 01.13.2011

Start: 9:00

Primary Goal:  Get the controller test to work across the wire.

  • Adding a isDirty flag is not as easy as it would seem.  The only real link between the entry and the data is the void pointer.
  • Added a new method for setting commands to the DataDictionary.  The parameters for this method are the dd entry name and the command you want to set.  Since we are using explicit command objects to set the command, we don’t need validation.  If I go back and optimize memory usage, I will have to change this.
  • I didn’t want to send an empty buffer when nothing was there, but it seems readfile requires data to be received or it waits there forever.
  • In order to keep it synchronized at the start, the arduino does not start sending data until it recieves a empty packet from the pc.  I can see the light flash showing the computer sending the packet, but it doesn’t change the state to start sending.
  • The internal serial buffer of the arduino is only 128 bytes…  Well I guess that is the solution to a ton of problems.  I am going to have to change the way things work, to send each data item individually.  Oh well, after yesterdays memory problems, I realized this would probably be the better route anyways.
  • For some reason, the project isn’t recognizing that I changed the library which holds commgr to have a buffer of 128.  Its overflowing the ComUtil and causing it to become corrupted.
  • Need to try to find a non blocking serial method for windows

End: 4:00

Arduino serial packets can only be 128bytes each.  Larger items will have to be sent in multiple packets, but it should be large enough for most.

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